Skip to content

Commit

Permalink
new release process using an action (and docs to go with it). note, u…
Browse files Browse the repository at this point in the history
…ntested but can work through issues on the next release
  • Loading branch information
shnewto committed Nov 12, 2023
1 parent b976422 commit 5fbe071
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/tag-and-publish.yaml
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
22 changes: 22 additions & 0 deletions RELEASE.md
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`

0 comments on commit 5fbe071

Please sign in to comment.