|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "stable-*" |
| 7 | + - "beta-*" |
| 8 | + - "alpha-*" |
| 9 | + - "index-*" |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + name: Release |
| 14 | + runs-on: ubuntu-24.04 |
| 15 | + permissions: |
| 16 | + contents: write |
| 17 | + steps: |
| 18 | + - name: Code checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Create release branch and bump version |
| 22 | + env: |
| 23 | + REF_NAME: ${{ github.ref_name }} |
| 24 | + run: | |
| 25 | + BRANCH=release/"${REF_NAME}" |
| 26 | + git config --local user.email '[email protected]' |
| 27 | + git config --local user.name 'Blueprint CI' |
| 28 | + git checkout -b "$BRANCH" |
| 29 | + git push -u origin "$BRANCH" |
| 30 | + sed -i "s/VERSION=\"rolling\" #;/VERSION=\"${REF_NAME}\" #;/" blueprint.sh |
| 31 | + git add blueprint.sh |
| 32 | + git commit -m 'ci(release): bump version' |
| 33 | + git push |
| 34 | +
|
| 35 | + - name: Create release archive |
| 36 | + env: |
| 37 | + REF_NAME: ${{ github.ref_name }} |
| 38 | + run: | |
| 39 | + zip -r "${REF_NAME}.zip" * .eslintrc.js .prettierignore .prettierrc.json .shellcheckrc |
| 40 | +
|
| 41 | + - name: Create changelog |
| 42 | + env: |
| 43 | + REF_NAME: ${{ github.ref_name }} |
| 44 | + run: | |
| 45 | + echo "[**Changelog**](https://blueprint.zip/releases/${REF_NAME})" > ./RELEASE_CHANGELOG |
| 46 | +
|
| 47 | + - name: Create checksum and add to changelog |
| 48 | + env: |
| 49 | + REF_NAME: ${{ github.ref_name }} |
| 50 | + run: | |
| 51 | + SUM=`sha256sum "${REF_NAME}.zip"` |
| 52 | + echo -e "\n#### SHA256 Checksum\n\n\`\`\`\n$SUM\n\`\`\`\n" >> ./RELEASE_CHANGELOG |
| 53 | + echo "$SUM" > checksum.txt |
| 54 | +
|
| 55 | + - name: Create release |
| 56 | + id: create_release |
| 57 | + uses: softprops/action-gh-release@v2 |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + with: |
| 61 | + draft: true |
| 62 | + prerelease: ${{ contains(github.ref, 'rc') }} |
| 63 | + body_path: ./RELEASE_CHANGELOG |
| 64 | + files: | |
| 65 | + ${{ github.ref_name }}.zip |
| 66 | + checksum.txt |
0 commit comments