|
| 1 | +name: VirtualOS |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: release-${{ github.head_ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +env: |
| 13 | + MISE_EXPERIMENTAL: "1" |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: "Build" |
| 18 | + runs-on: "macos-13" |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - id: skip_release |
| 22 | + run: | |
| 23 | + # Get the commit message of the latest commit |
| 24 | + commit_message=$(git log -1 --pretty=format:%s) |
| 25 | + echo "Commit message: $commit_message" |
| 26 | + # Check if the commit message starts with 'release' |
| 27 | + if [[ "$commit_message" == release* ]]; then |
| 28 | + echo "SKIP_RELEASE=true" >> $GITHUB_ENV |
| 29 | + else |
| 30 | + echo "SKIP_RELEASE=false" >> $GITHUB_ENV |
| 31 | + fi |
| 32 | + - uses: jdx/mise-action@v2 |
| 33 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 34 | + - run: mise run install |
| 35 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 36 | + - name: bundle |
| 37 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 38 | + env: |
| 39 | + CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} |
| 40 | + APPLE_ID: ${{ secrets.APPLE_ID }} |
| 41 | + APP_SPECIFIC_PASSWORD: ${{ secrets.APP_SPECIFIC_PASSWORD }} |
| 42 | + CERTIFICATE_ENCRYPTION_PASSWORD: ${{ secrets.CERTIFICATE_ENCRYPTION_PASSWORD }} |
| 43 | + TUIST_CONFIG_TOKEN: ${{ secrets.TUIST_CONFIG_TOKEN }} |
| 44 | + run: mise run bundle |
| 45 | + - name: Get next version |
| 46 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 47 | + id: version |
| 48 | + run: | |
| 49 | + echo "VERSION=$(git cliff --bumped-version)" >> $GITHUB_ENV |
| 50 | + - name: Generate changelog |
| 51 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 52 | + id: changelog |
| 53 | + run: | |
| 54 | + git-cliff --bump -o CHANGELOG.md |
| 55 | + - name: Generate release notes |
| 56 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 57 | + id: release-notes |
| 58 | + run: | |
| 59 | + echo "RELEASE_NOTES=$(git cliff --latest)" >> $GITHUB_ENV |
| 60 | + - uses: stefanzweifel/git-auto-commit-action@v5 |
| 61 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 62 | + with: |
| 63 | + commit_message: release ${{ steps.version.outputs.VERSION }} |
| 64 | + - name: Release |
| 65 | + uses: softprops/action-gh-release@v2 |
| 66 | + if: steps.skip_release.outputs.SKIP_RELEASE == 'false' |
| 67 | + with: |
| 68 | + body: ${{ steps.release-notes.outputs.RELEASE_NOTES }} |
| 69 | + draft: false |
| 70 | + name: ${{ steps.version.outputs.VERSION }} |
| 71 | + tag_name: ${{ steps.version.outputs.VERSION }} |
| 72 | + make_latest: true |
| 73 | + files: | |
| 74 | + build/artifacts/virtualos.zip |
| 75 | + build/artifacts/SHASUMS256.txt |
| 76 | + build/artifacts/SHASUMS512.txt |
| 77 | +
|
| 78 | +
|
0 commit comments