chore(challenge): release v1.1.11 #8
Workflow file for this run
This file contains hidden or 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: Create GitHub Release for @mintpass/challenge | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: challenge | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed for changelog generation | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Generate changelog | |
| run: yarn changelog | |
| - name: Extract release notes from changelog | |
| run: | | |
| # Extract the version from the tag (e.g., v1.1.8 -> 1.1.8) | |
| VERSION="${{ github.ref_name }}" | |
| VERSION="${VERSION#v}" | |
| # Extract the section for this version from CHANGELOG.md | |
| # This uses awk to get everything between the current version header and the next version header | |
| awk -v ver="$VERSION" ' | |
| /^## \[/ { | |
| if (found) exit | |
| if ($0 ~ "\\[" ver "\\]") found=1 | |
| } | |
| found { print } | |
| ' CHANGELOG.md > RELEASE_NOTES.md | |
| # If empty, create a simple note | |
| if [ ! -s RELEASE_NOTES.md ]; then | |
| echo "Release ${{ github.ref_name }}" > RELEASE_NOTES.md | |
| fi | |
| echo "Generated release notes:" | |
| cat RELEASE_NOTES.md | |
| - name: Check if release exists | |
| id: check_release | |
| run: | | |
| if gh release view ${{ github.ref_name }} &>/dev/null; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| working-directory: ${{ github.workspace }} | |
| - name: Create GitHub Release | |
| if: steps.check_release.outputs.exists == 'false' | |
| run: | | |
| gh release create ${{ github.ref_name }} \ | |
| --title "@mintpass/challenge ${{ github.ref_name }}" \ | |
| --notes-file challenge/RELEASE_NOTES.md \ | |
| --draft=false \ | |
| --latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| working-directory: ${{ github.workspace }} |