diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e6f7ab..a188760 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,12 +23,20 @@ jobs: rid: osx-arm64 runs-on: ${{ matrix.os }} steps: + # GitVersion counts commits since the last tag, so a shallow clone gives it nothing to count. - uses: actions/checkout@v7 + with: + fetch-depth: 0 - uses: actions/setup-dotnet@v6 with: dotnet-version: 10.0.x - - run: dotnet build Stampeded.slnx -c Release + - run: dotnet tool restore + + - name: Run GitVersion + run: dotnet tool run dotnet-gitversion /output buildserver /nofetch + + - run: dotnet build Stampeded.slnx -c Release -p:Version=${{ env.GitVersion_SemVer }} - run: dotnet test --solution Stampeded.slnx -c Release --no-build --report-trx --results-directory test-results - uses: actions/upload-artifact@v7 @@ -53,13 +61,13 @@ jobs: - name: Zip (Windows) if: runner.os == 'Windows' shell: pwsh - run: Compress-Archive -Path publish/win-x64/* -DestinationPath Stampeded-win-x64.zip + run: Compress-Archive -Path publish/win-x64/* -DestinationPath Stampeded-${{ env.GitVersion_SemVer }}-win-x64.zip # Info-ZIP keeps the execute bit; Compress-Archive and upload-artifact drop it. - name: Zip (Linux) if: runner.os == 'Linux' shell: bash - run: cd publish/linux-x64 && zip -r -q ../../Stampeded-linux-x64.zip . + run: cd publish/linux-x64 && zip -r -q ../../Stampeded-${{ env.GitVersion_SemVer }}-linux-x64.zip . # Unsigned and unnotarized: first launch needs `xattr -dr com.apple.quarantine Stampeded.app`. - name: dmg (macOS) @@ -69,11 +77,11 @@ jobs: mkdir dmg cp -R publish/osx-arm64/Stampeded.app dmg/ ln -s /Applications dmg/Applications - hdiutil create -volname Stampeded -srcfolder dmg -ov -format UDZO Stampeded-macos-arm64.dmg + hdiutil create -volname Stampeded -srcfolder dmg -ov -format UDZO Stampeded-${{ env.GitVersion_SemVer }}-macos-arm64.dmg - uses: actions/upload-artifact@v7 with: - name: Stampeded-${{ matrix.rid }} + name: Stampeded-${{ env.GitVersion_SemVer }}-${{ matrix.rid }} path: | Stampeded-*.zip Stampeded-*.dmg diff --git a/dotnet-tools.json b/dotnet-tools.json new file mode 100644 index 0000000..afa19da --- /dev/null +++ b/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "gitversion.tool": { + "version": "6.8.2", + "commands": [ + "dotnet-gitversion" + ], + "rollForward": false + } + } +} \ No newline at end of file