ci: adopt prepare/build split with exec plugin for version detection #62
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: Build Millennium | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install Semantic Release | |
| run: npm install --save-dev semantic-release @semantic-release/github @semantic-release/exec @semantic-release/changelog @semantic-release/git | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get Next Version | |
| id: get_version | |
| run: cd resources/versioning && npx semantic-release --dry-run --no-ci | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-windows: | |
| needs: prepare | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Update Version | |
| if: ${{ needs.prepare.outputs.version != '' }} | |
| run: | | |
| echo "# current version of millennium installer" > resources/versioning/version | |
| echo "v${{ needs.prepare.outputs.version }}" >> resources/versioning/version | |
| - name: Build Millennium | |
| run: | | |
| cmake --preset=windows-release | |
| cmake --build build | |
| mkdir -p D:/a/build/unsigned | |
| mv build/Installer.exe D:/a/build/unsigned/MillenniumInstaller-Windows.exe | |
| - name: Upload Build Artifact | |
| id: upload-unsigned-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| include-hidden-files: true | |
| name: millennium-windows | |
| path: D:/a/build/unsigned/MillenniumInstaller-Windows.exe | |
| - name: Sign Installer Build | |
| id: sign_artifact | |
| uses: signpath/github-action-submit-signing-request@v1.1 | |
| with: | |
| api-token: "${{ secrets.SIGNPATH_API_TOKEN }}" | |
| organization-id: "f90532fc-e58c-4863-bc0d-72623720335f" | |
| project-slug: "Millenium_Installer" | |
| signing-policy-slug: "release-signing" | |
| artifact-configuration-slug: "millennium-installer-release-config" | |
| github-artifact-id: "${{ steps.upload-unsigned-artifact.outputs.artifact-id }}" | |
| output-artifact-directory: "signed-millennium" | |
| wait-for-completion: true | |
| - name: Upload Signed Build Release | |
| id: upload-signed-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| include-hidden-files: true | |
| name: millennium-windows-signed | |
| path: "signed-millennium/MillenniumInstaller-Windows.exe" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install Semantic Release | |
| run: npm install --save-dev semantic-release @semantic-release/github @semantic-release/exec @semantic-release/changelog @semantic-release/git | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| run: cd resources/versioning && npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |