Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam committed Nov 18, 2024
1 parent 394875d commit c9b7a58
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
workflow_dispatch:
release:
types: [ "published" ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Pack
run: ./build.sh pack
shell: bash

- name: Sign Nuget package
env:
NUGET_SIGNING_PFX: ${{ secrets.NUGET_SIGNING_PFX }}
NUGET_ROOT_SIGNING_CERT: ${{ secrets.NUGET_ROOT_SIGNING_CERT }}
run: |
sudo mkdir -p /etc/pki/ca-trust/extracted/pem/
echo "$NUGET_ROOT_SIGNING_CERT" | sudo tee -a /etc/pki/ca-trust/extracted/pem/objsign-ca-bundle.pem > /dev/null
echo "$NUGET_SIGNING_PFX" | openssl base64 -d -out private.pfx
dotnet nuget sign nuget/*.nupkg --certificate-path private.pfx --timestamper http://timestamp.sectigo.com
shell: bash

- name: Publish NuGet package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push nuget/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: RankLibNugetPkgs
path: nuget

0 comments on commit c9b7a58

Please sign in to comment.