forked from clj-commons/etaoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mostly cribbed from rewrite-clj. Currently invoked from GitHub Actions UI. Version scheme is major.minor.<release count>. See new maintainer guide for details. Closes clj-commons#422
- Loading branch information
Showing
8 changed files
with
389 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
environment: release | ||
|
||
runs-on: ubuntu-latest | ||
# I do not know of a way to restrict to the main branch so try to skip the whole job if | ||
# user selected some other branch from GitHub Actions GUI | ||
if: github.ref == 'refs/heads/main' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Git User so that we can later commit | ||
uses: fregante/setup-git-user@v1 | ||
|
||
- name: Clojure deps cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
~/.deps.clj | ||
~/.gitlibs | ||
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} | ||
restore-keys: cljdeps- | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Install Clojure Tools | ||
uses: DeLaGuardo/[email protected] | ||
with: | ||
bb: 'latest' | ||
|
||
- name: Tools Versions | ||
run: | | ||
echo "bb --version" | ||
bb --version | ||
echo "java -version" | ||
java -version | ||
- name: Download Clojure Dependencies | ||
run: bb download-deps | ||
|
||
- name: Release Prep (step 1 of 4) | ||
run: bb ci-release prep | ||
|
||
- name: Release Deploy (step 2 of 4) | ||
env: | ||
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} | ||
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} | ||
run: bb ci-release deploy-remote | ||
|
||
- name: Release Commit (step 3 of 4) | ||
run: bb ci-release commit | ||
|
||
- name: Make GitHub Actions aware of target version tag | ||
run: echo "::set-output name=tag::v$(bb clojure -T:build built-version)" | ||
id: target-version | ||
|
||
- name: Create GitHub release (step 4 of 4) | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.target-version.outputs.tag}} | ||
release_name: ${{ steps.target-version.outputs.tag}} | ||
commitish: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,66 @@ | ||
= Maintainer Guide | ||
:toclevels: 5 | ||
:toc: | ||
:url-release-action: https://github.com/clj-commons/etaoin/actions?query=workflow%3A%22Release%22 | ||
|
||
== Introduction | ||
Coming soon | ||
Notes for project maintainers. | ||
|
||
== Release Workflow | ||
|
||
The release workflow is handled by our link:{url-release-action}[Release] GitHub Action. | ||
|
||
. Fail fast if: | ||
.. Change log not ready | ||
. Bump `version.edn` for release version | ||
. Create thin jar using release version | ||
. Apply release version to the following docs: | ||
.. user guide for usage examples | ||
.. change log "unreleased" heading | ||
. Deploy jar to clojars | ||
. Commit changes made to docs and `version.edn` | ||
. Create and push a release tag back to the project repo | ||
. Inform cljdoc of the new release | ||
|
||
[IMPORTANT] | ||
==== | ||
At this time, the release workflow does not run tests. | ||
The assumption is that you've waited for the last CI test run to complete and are happy with the results. | ||
==== | ||
|
||
== Updating the Version | ||
|
||
Release num is bumped automatically by release workflow. | ||
|
||
Edit `major` and `minor` by editing `version.edn` in the project root. | ||
|
||
== Local Verification | ||
|
||
To check if things seeem ready: | ||
|
||
[source,shell] | ||
---- | ||
bb ci-release validate | ||
---- | ||
|
||
If you want to run everything up to, but not including, commit and push: | ||
|
||
[source,shell] | ||
---- | ||
bb ci-release prep | ||
---- | ||
|
||
IMPORTANT: You will NOT want to check in changes made by `prep`. | ||
|
||
== Special Setup | ||
|
||
GitHub has been configured with necessary secrets for GitHub Actions to deploy to clojars. | ||
|
||
== Invoking | ||
|
||
As a maintainer you should have sufficient privileges to see a "Run Workflow" dropdown button on the link:{url-release-action}[Release] action page. | ||
The dropdown will prompt for a branch. | ||
I did not see a way to disable this prompt, simply leave it at "master" and run the workflow. | ||
|
||
TIP: Don't forget to pull after a release to get the changes made by the release workflow. | ||
|
Oops, something went wrong.