Split CI action into two

Needed because the code signing action requires knowing the artifact upload ID, which as far as I know, is impossible to obtain under a matrix
This commit is contained in:
pizzaboxer 2024-10-14 00:44:15 +01:00
parent 8b781c176d
commit 7e59537b17
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 92 additions and 66 deletions

30
.github/workflows/ci-debug.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: CI (Debug)
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Publish
run: dotnet publish -p:PublishSingleFile=true -p:CommitHash=${{ github.sha }} -p:CommitRef=${{ github.ref_type }}/${{ github.ref_name }} -r win-x64 -c Debug --self-contained false .\Bloxstrap\Bloxstrap.csproj
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Bloxstrap (Debug) (${{ github.sha }})
path: .\Bloxstrap\bin\Debug\net6.0-windows\win-x64\publish\*

View File

@ -1,66 +1,62 @@
name: CI name: CI (Release)
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build: build:
strategy: runs-on: windows-latest
matrix:
configuration: [Debug, Release] outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
runs-on: windows-latest
steps:
steps: - uses: actions/checkout@v4
- uses: actions/checkout@v4 with:
with: submodules: true
submodules: true
- uses: actions/setup-dotnet@v4
- uses: actions/setup-dotnet@v4 with:
with: dotnet-version: '6.0.x'
dotnet-version: '6.0.x'
- name: Restore dependencies
- name: Restore dependencies run: dotnet restore
run: dotnet restore
- name: Build
- name: Build run: dotnet build --no-restore
run: dotnet build --no-restore
- name: Publish
- name: Publish run: dotnet publish -p:PublishSingleFile=true -p:CommitHash=${{ github.sha }} -p:CommitRef=${{ github.ref_type }}/${{ github.ref_name }} -r win-x64 -c Release --self-contained false .\Bloxstrap\Bloxstrap.csproj
run: dotnet publish -p:PublishSingleFile=true -p:CommitHash=${{ github.sha }} -p:CommitRef=${{ github.ref_type }}/${{ github.ref_name }} -r win-x64 -c ${{ matrix.configuration }} --self-contained false .\Bloxstrap\Bloxstrap.csproj
- name: Upload Artifact
- name: Upload Artifact id: upload-artifact
id: upload-artifact-${{ matrix.configuration }} uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4 with:
with: name: Bloxstrap (Release) (${{ github.sha }})
name: Bloxstrap (${{ matrix.configuration }}) path: .\Bloxstrap\bin\Release\net6.0-windows\win-x64\publish\*
path: |
.\Bloxstrap\bin\${{ matrix.configuration }}\net6.0-windows\win-x64\publish\* release:
needs: build
release: runs-on: ubuntu-latest
needs: build if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') steps:
- name: Sign and download artifact
steps: uses: signpath/github-action-submit-signing-request@v1
- name: Sign and download release artifact with:
uses: signpath/github-action-submit-signing-request@v1 api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
with: organization-id: '107b3de5-057b-42fc-a985-3546e4261775'
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' project-slug: 'bloxstrap'
organization-id: '107b3de5-057b-42fc-a985-3546e4261775' signing-policy-slug: 'release-signing'
project-slug: 'bloxstrap' artifact-configuration-slug: 'github-ci'
signing-policy-slug: 'release-signing' github-artifact-id: '${{ needs.build.outputs.artifact-id }}'
artifact-configuration-slug: 'github-ci' wait-for-completion: true
github-artifact-id: '${{ steps.upload-artifact-Release.outputs.artifact-id }}' output-artifact-directory: 'release'
wait-for-completion: true
output-artifact-directory: 'release' - name: Rename binaries
run: mv release/Bloxstrap.exe Bloxstrap-${{ github.ref_name }}.exe
- name: Rename binaries
run: | - name: Create release
mv release/Bloxstrap.exe Bloxstrap-${{ github.ref_name }}.exe uses: softprops/action-gh-release@v2
with:
- name: Release draft: true
uses: softprops/action-gh-release@v2 files: Bloxstrap-${{ github.ref_name }}.exe
with: name: Bloxstrap ${{ github.ref_name }}
draft: true
files: |
Bloxstrap-${{ github.ref_name }}.exe
name: Bloxstrap ${{ github.ref_name }}