π¦ Release - 23a4272d2877fdbe9cea981ba79c400bd6270fa4 #68
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 - Tag, Release, Publish and Deploy | |
run-name: π¦ Release - ${{ inputs.tag-name || github.sha || github.ref }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
inputs: | |
tag-name: | |
description: Tag name | |
required: false | |
type: string | |
skip-npm: | |
description: Skip npm publish | |
required: false | |
type: boolean | |
jobs: | |
release: | |
name: π¦ Tag and release commit | |
runs-on: ubuntu-latest | |
outputs: | |
tag-name: ${{ steps.push-tag.outputs.tag_name }} | |
commit-hash: ${{ steps.push-tag.outputs.commit_hash }} | |
steps: | |
- name: β Checkout branch ${{ github.ref }} | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
token: ${{ secrets.CI_TOKEN }} | |
- name: 𧱠Install | |
uses: ./.github/actions/install | |
- name: π·οΈ Release | |
run: | | |
# ================= π·οΈ Release ================= | |
# setup git credentials | |
git config user.name "GitHub Release Bot" | |
git config user.email "<>" | |
# generate release | |
pnpm run release | |
- name: β Push to remote | |
id: push-tag | |
run: | | |
# ================= β Remote ================= | |
# Check status | |
git status | |
git diff --color -U0 | cat | |
# push changes | |
git push origin --follow-tags | |
tag_name=$(git describe --abbrev=0 --match 'v*') | |
commit_hash=$(git rev-parse HEAD) | |
echo "Pushing tag: ${tag_name}" | |
echo "Pushing commit: ${commit_hash}" | |
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT" | |
echo "commit_hash=${commit_hash}" >> "$GITHUB_OUTPUT" | |
publish: | |
name: βοΈ Publish | |
needs: release | |
uses: ./.github/workflows/publish.yml | |
secrets: inherit | |
with: | |
commit-hash: ${{ needs.release.outputs.commit-hash }} | |
tag-name: ${{ inputs.tag-name || needs.release.outputs.tag-name }} | |
skip-npm: ${{ inputs.skip-npm }} | |
deploy: | |
name: π Deploy | |
needs: publish | |
uses: ./.github/workflows/deploy.yml | |
secrets: inherit |