-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new release process using an action (and docs to go with it). note, u…
…ntested but can work through issues on the next release
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 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,62 @@ | ||
name: tag and publish [manual] | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag-increment: | ||
default: patch | ||
required: true | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
publish: | ||
runs-on: macos-latest | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v2 | ||
- name: install elm | ||
run: | | ||
npm install -g elm | ||
- name: build | ||
run: | | ||
elm make | ||
- name: build docs | ||
run: | | ||
elm make --docs=docs.json | ||
- name: install elm-format | ||
run: | | ||
npm install -g elm-format | ||
- name: format | ||
run: | | ||
elm-format src --validate | ||
- name: install elm-test | ||
run: | | ||
npm install -g elm-test | ||
- name: test | ||
run: | | ||
elm-test | ||
- name: bump-version | ||
run: | | ||
ELM_BUMP_OUTPUT="$(echo 'y' | elm bump)" | ||
echo "NEW_TAG=$($ELM_BUMP_OUTPUT | grep -Eoh '[0-9]+[.][0-9]+[.][0-9]+')" >> $GITHUB_OUTPUT | ||
echo "$ELM_BUMP_OUTPUT" | ||
- name: commit | ||
run: | | ||
git add elm.json | ||
git commit -m "updating version to ${{ steps.bump-version.outputs.NEW_TAG }}" | ||
git push | ||
- name: add tag | ||
run: | | ||
git tag -a ${{ steps.bump-version.outputs.NEW_TAG }} -m ${{ steps.bump-version.outputs.NEW_TAG }} | ||
git push --tags | ||
- name: publish | ||
run: | | ||
elm publish |
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,22 @@ | ||
# Release Process | ||
|
||
- leave the elm.json package version alone :) | ||
- trigger the `tag and publish [manual]` action and specify the release increment (major, minor, or patch) | ||
- once the action completes, the elm.json will be updated and the package will be live on package.elm-lang.org | ||
- create a release (with title, notes, thanks, etc) and tie it to the tag that was created by the action / new package version | ||
|
||
## Execution | ||
|
||
The order of operations for tagging and publishing in the action is this | ||
|
||
1. run all checks, i.e. format, docs, tests, etc | ||
1. push change / update to the elm.json | ||
1. push the new tag to the repo | ||
1. publish the new version to elm package registry | ||
|
||
## Troubleshooting | ||
|
||
- if step 1 of execution fails, after addressing the error, you run the action again | ||
- if step 2 of execution fails, after addressing the error, you run the action again | ||
- if step 3 of execution fails (the elm.json version was incremented), after addressing the error, you should manually tag (github's ux or the cli) and manually publish the package with `elm publish` | ||
- if step 4 of execution fails (the elm.json version was incremented and there's a new corresponding tag), after addressing the error, you should manually publish the package with `elm publish` |