bloxstrap/.github/workflows/ci.yml
pizzaboxer eaa5ca5d81
Setup CI action for release code signing
i have zero faith that this will work first try 👍
2024-10-13 20:26:16 +01:00

67 lines
2.0 KiB
YAML

name: CI
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
configuration: [Debug, Release]
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 ${{ matrix.configuration }} --self-contained false .\Bloxstrap\Bloxstrap.csproj
- name: Upload Artifact
id: upload-artifact-${{ matrix.configuration }}
uses: actions/upload-artifact@v4
with:
name: Bloxstrap (${{ matrix.configuration }})
path: |
.\Bloxstrap\bin\${{ matrix.configuration }}\net6.0-windows\win-x64\publish\*
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Sign and download release artifact
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '107b3de5-057b-42fc-a985-3546e4261775'
project-slug: 'bloxstrap'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'github-ci'
github-artifact-id: '${{ steps.upload-artifact-Release.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: 'release'
- name: Rename binaries
run: |
mv release/Bloxstrap.exe Bloxstrap-${{ github.ref_name }}.exe
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
Bloxstrap-${{ github.ref_name }}.exe
name: Bloxstrap ${{ github.ref_name }}