Release v0.1.0-2 #3
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
--- | |
name: Release | |
run-name: Release ${{inputs.tag}} | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "tag" | |
required: true | |
ref: | |
description: "released ref (branch, tag or SHA). By default, the default branch is used" | |
required: false | |
pr: | |
description: "pr number (pre-release)" | |
required: false | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
env: | |
PR: ${{inputs.pr}} | |
TAG: ${{inputs.tag}} | |
steps: | |
- run: | | |
echo "::notice::tag: $TAG, pr: $PR, ref: $REF" | |
env: | |
REF: ${{inputs.ref}} | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
with: | |
ref: ${{inputs.ref}} | |
- run: gh pr checkout "$PR" | |
if: inputs.pr != '' | |
env: | |
GITHUB_TOKEN: ${{github.token}} | |
- uses: aquaproj/aqua-installer@6ce1f8848ec8e61f14d57bd5d7597057a6dd187c # v3.0.1 | |
with: | |
aqua_version: v2.36.2 | |
env: | |
AQUA_GITHUB_TOKEN: ${{github.token}} | |
- run: echo "BASE_REVISION=$(git rev-parse HEAD)" >> "$GITHUB_ENV" | |
- run: gh auth setup-git | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
# https://github.community/t/github-actions-bot-email-address/17204/5 | |
- run: git config user.name "github-actions[bot]" | |
- run: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- run: cmdx build | |
- run: find ./dist/* -print0 | xargs -0 git add -f | |
- run: git checkout -b "release/${TAG}" | |
- run: | | |
git commit -a -m "chore: release ${TAG} | |
base revision: $BASE_REVISION" | |
- run: git tag "$TAG" | |
- run: git push origin "$TAG" | |
- run: | | |
gh release create "$TAG" -p --title "$TAG" -n "$NOTE" | |
env: | |
NOTE: "[Issues](https://github.com/suzuki-shunsuke/lock-action/issues?q=is%3Aissue+is%3Aclosed+milestone%3A${{env.TAG}}) | [Pull Requests](https://github.com/suzuki-shunsuke/lock-action/pulls?q=is%3Apr+is%3Aclosed+milestone%3A${{env.TAG}}) | https://github.com/suzuki-shunsuke/lock-action/compare/${{env.TAG}}...${{env.TAG}} | [Base revision](https://github.com/suzuki-shunsuke/lock-action/tree/${{env.BASE_REVISION}})" | |
GITHUB_TOKEN: ${{ github.token }} | |
- run: github-comment post -pr "$PR" -k pre-release -var "tag:$TAG" | |
if: inputs.pr != '' | |
env: | |
GITHUB_TOKEN: ${{github.token}} |