Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(release): bump versions to the latest release #128

Merged
merged 8 commits into from
Jun 17, 2024
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release

on:
workflow_dispatch:
inputs:
version:
default: "0.0.1"
zimeg marked this conversation as resolved.
Show resolved Hide resolved
description: "Version of the release"
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
env:
VERSION: ${{ inputs.version }}
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
zimeg marked this conversation as resolved.
Show resolved Hide resolved
- name: configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
Comment on lines +17 to +20
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these steps actually necessary? IIRC there are some defaults set up that you can use, no?

Also, whose email is this? Yours?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do some testing without this step! I'm guessing the user.* of whoever runs the workflow will be used, but am not certain...

This is a somewhat secret email used for @github-actions[bot] based on the ID and username - I tend to use it for workflow related things like this, but no problem removing it if all still works!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL not having this will cause the action to error. I'm not sure of an alternative right now, but open to trying other things!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like having this magic email, but somehow I'm not surprised GitHub workflows don't have a proper solution for this :)

- name: bump versions
run: |
DATE=$(date +"%B %d %Y")
zimeg marked this conversation as resolved.
Show resolved Hide resolved
MANPAGE=".TH wd \"1\" \"$DATE\" \"wd $VERSION\" \"wd Manual\""
sed -i -E "1 s/.*/$MANPAGE/" wd.1
sed -i -E "s/WD_VERSION=.*/WD_VERSION=$VERSION/" wd.sh
- name: commit changes
run: |
git add wd.1 wd.sh
git commit -m "chore(update): bump current version to v$VERSION"
git tag v$VERSION
zimeg marked this conversation as resolved.
Show resolved Hide resolved
git push -u origin master --tags
- name: release latest
run: |
gh release create v$VERSION --generate-notes
env:
alpha-tango-kilo marked this conversation as resolved.
Show resolved Hide resolved
GH_TOKEN: ${{ github.token }}
Loading