Skip to content

Commit

Permalink
Merge pull request #5 from leinardi/master
Browse files Browse the repository at this point in the history
Add release workflow
  • Loading branch information
leinardi authored Oct 22, 2024
2 parents 0b380f3 + 961fd08 commit 23ade24
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Any HTML comment will be stripped when the markdown is rendered, so you don't ne
### Pull request checklist

<!-- replace the empty checkboxes [ ] below with checked ones [x] accordingly -->

- [ ] I have **rebased** this branch on top of the destination branch (usually `master`)
- [ ] I am targeting the `master` branch (and **not** the `release` branch)
- [ ] I have **rebased** this branch on top of the destination branch
- [ ] I have executed locally `make check` *before creating the commit* and it has run successfully
- [ ] My contribution is fully baked and ready to be merged as is
- [ ] I have performed a self-review of my own code
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
workflow_dispatch:
inputs:
semver:
description: 'Release Semantic Versioning (e.g. 4.15.2)'
required: true

jobs:
release:
name: Release
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
TERM: dumb

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create release tag
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ github.event.inputs.semver }}",
sha: context.sha
})
- name: Workaround to fetch the tag # Is there a better way to do it?
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ github.event.inputs.semver }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Delete release tag
if: ${{ failure() || cancelled() }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/${{ github.event.inputs.semver }}"
})

0 comments on commit 23ade24

Please sign in to comment.