Bump version number #54
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: build | |
| on: | |
| push: | |
| paths: | |
| - "**/*" | |
| - "!.*" | |
| - "!.github/**/*" | |
| - "!README.md" | |
| workflow_dispatch: | |
| jobs: | |
| assembling: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install NASM | |
| uses: ilammy/setup-nasm@v1 | |
| - name: Assemble injections | |
| shell: cmd | |
| run: make src/inc/injections.inc | |
| - name: Cache intermediate build results | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| metadata | |
| src | |
| bin | |
| key: intermediate1-${{ github.run_id }}-${{ github.run_attempt }} | |
| linking: | |
| runs-on: windows-latest | |
| needs: assembling | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Fetch intermediate build results | |
| uses: actions/cache/restore@v4 | |
| with: | |
| fail-on-cache-miss: true | |
| path: | | |
| metadata | |
| src | |
| bin | |
| key: intermediate1-${{ github.run_id }}-${{ github.run_attempt }} | |
| - name: Install NASM | |
| uses: ilammy/setup-nasm@v1 | |
| - name: Download GoDevTools | |
| run: | | |
| Invoke-WebRequest http://godevtool.com/Golink.zip -OutFile golink.zip | |
| Invoke-WebRequest http://godevtool.com/Gorc.zip -OutFile gorc.zip | |
| unzip golink.zip GoLink.exe | |
| unzip gorc.zip GoRC.exe | |
| - name: Assemble Ninja.dll | |
| shell: cmd | |
| run: make build/Ninja.dll | |
| - name: Assemble BugslayerUtil.dll | |
| shell: cmd | |
| run: make build/BugslayerUtil.dll | |
| - name: Cache intermediate build results | |
| uses: actions/cache/save@v4 | |
| with: | |
| # Cache all source files for make timestamps | |
| path: | | |
| metadata | |
| LICENSE | |
| src | |
| bin | |
| build | |
| key: intermediate2-${{ github.run_id }}-${{ github.run_attempt }} | |
| - name: Calculate checksum | |
| run: | | |
| $crc = crc32 build/Ninja.dll | |
| echo "::notice title=Ninja.dll (unsigned) CRC32::0x$($crc.ToUpper())" | |
| - name: Upload DLLs as workflow artifact | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ninja | |
| path: build/*.dll | |
| setup: | |
| runs-on: windows-latest | |
| needs: linking | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Fetch intermediate build results | |
| uses: actions/cache/restore@v4 | |
| with: | |
| fail-on-cache-miss: true | |
| path: | | |
| metadata | |
| LICENSE | |
| src | |
| bin | |
| build | |
| key: intermediate2-${{ github.run_id }}-${{ github.run_attempt }} | |
| - name: Build NSIS setup | |
| shell: cmd | |
| run: make all | |
| - name: Cache build results | |
| uses: actions/cache/save@v4 | |
| with: | |
| enableCrossOsArchive: true | |
| path: build | |
| key: results-${{ github.run_id }}-${{ github.run_attempt }} | |
| - name: Export version | |
| shell: bash | |
| run: | | |
| source metadata | |
| echo "VERSION=$VBASE.$VMAJOR.$VMINOR" >> $GITHUB_ENV | |
| - name: Calculate checksum | |
| run: | | |
| $sha = (Get-FileHash build/Ninja-${{ env.VERSION }}.exe).Hash | |
| echo "::notice title=Ninja-${{ env.VERSION }}.exe (unsigned) SHA-256::$sha" | |
| - name: Upload setup as workflow artifact | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: setup | |
| path: build/Ninja-*.exe | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| if: ${{ !cancelled() }} | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Clear cache | |
| run: | | |
| gh extension install actions/gh-actions-cache | |
| gh actions-cache delete intermediate1-${{ github.run_id }}-${{ github.run_attempt }} -R ${{ github.repository }} --confirm | |
| gh actions-cache delete intermediate2-${{ github.run_id }}-${{ github.run_attempt }} -R ${{ github.repository }} --confirm | |
| gh actions-cache delete results-${{ github.run_id }}-${{ github.run_attempt }} -R ${{ github.repository }} --confirm | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |