ModernUO/.github/workflows/build-tool-release.yml
dependabot[bot] bec4cfa910
chore(deps): bump actions/setup-dotnet from 5 to 6 (#2545)
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 5 to 6.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-21 16:30:40 -07:00

163 lines
4.6 KiB
YAML

name: Build Tool Release
on:
push:
branches: [main]
paths:
- 'Projects/BuildTool/**'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
name: Build (${{ matrix.rid }})
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
artifact: build-tool-win-x64.exe
- os: windows-latest
rid: win-arm64
artifact: build-tool-win-arm64.exe
- os: macos-15
rid: osx-arm64
artifact: build-tool-osx-arm64
- os: ubuntu-latest
rid: linux-x64
artifact: build-tool-linux-x64
- os: ubuntu-24.04-arm
rid: linux-arm64
artifact: build-tool-linux-arm64
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # Full clone required for Nerdbank.GitVersioning
- name: Install .NET
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
- name: Publish NativeAOT
run: dotnet publish Projects/BuildTool/BuildTool.csproj -c Release -r ${{ matrix.rid }} -o publish/
- name: Rename artifact (Unix)
if: runner.os != 'Windows'
run: mv publish/build-tool publish/${{ matrix.artifact }}
- name: Rename artifact (Windows)
if: runner.os == 'Windows'
run: mv publish/build-tool.exe publish/${{ matrix.artifact }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}
path: publish/${{ matrix.artifact }}
sign:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
name: Sign (${{ matrix.artifact }})
permissions:
actions: read
contents: read
id-token: write
strategy:
matrix:
include:
- artifact: build-tool-win-x64.exe
- artifact: build-tool-win-arm64.exe
steps:
- name: Download unsigned artifact
uses: actions/download-artifact@v8
with:
name: ${{ matrix.artifact }}
path: unsigned/
- name: Upload for signing
id: upload-for-signing
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}-unsigned
path: unsigned/${{ matrix.artifact }}
- name: Submit signing request
id: submit
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '${{ secrets.SIGNPATH_ORGANIZATION_ID }}'
project-slug: 'modernuo'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'build-tool'
github-artifact-id: '${{ steps.upload-for-signing.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: signed/
- name: Upload signed artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}-signed
path: signed/${{ matrix.artifact }}
release:
needs: [build, sign]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Move tag to current commit
run: |
git tag -f build-tool-latest
git push origin build-tool-latest --force
- name: Download signed Windows artifacts
uses: actions/download-artifact@v8
with:
pattern: '*-signed'
path: artifacts/
merge-multiple: true
- name: Download macOS artifacts
uses: actions/download-artifact@v8
with:
pattern: 'build-tool-osx-*'
path: artifacts/
merge-multiple: true
- name: Download Linux artifacts
uses: actions/download-artifact@v8
with:
pattern: 'build-tool-linux-*'
path: artifacts/
merge-multiple: true
- name: Generate checksums
run: |
cd artifacts
sha256sum build-tool-* > checksums-sha256.txt
- name: Create or update release
uses: softprops/action-gh-release@v3
with:
tag_name: build-tool-latest
name: Build Tool (Latest)
body: |
Latest NativeAOT-compiled build tool binaries.
These are automatically downloaded by `publish.cmd` / `publish.sh`.
prerelease: true
files: |
artifacts/build-tool-*
artifacts/checksums-sha256.txt
make_latest: false