Skip to content

Commit da0c14b

Browse files
authored
housekeeping: Updating the release workflow
1 parent ea28a37 commit da0c14b

File tree

1 file changed

+13
-75
lines changed

1 file changed

+13
-75
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,22 @@
1-
name: Build and Release
1+
name: Release
22

33
on:
44
push:
55
branches: [ main ]
6-
6+
77
env:
8-
configuration: Release
98
productNamespacePrefix: "Splat"
109

1110
jobs:
1211
release:
13-
runs-on: windows-2022
14-
environment:
15-
name: release
16-
outputs:
17-
nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
18-
steps:
19-
- name: Checkout
20-
uses: actions/[email protected]
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Install .NET Core
25-
uses: actions/[email protected]
26-
with:
27-
dotnet-version: 3.1.x
28-
29-
- name: Install .NET 5
30-
uses: actions/[email protected]
31-
with:
32-
dotnet-version: 5.0.x
33-
34-
- name: NBGV
35-
id: nbgv
36-
uses: dotnet/nbgv@master
37-
with:
38-
setAllVars: true
39-
40-
- name: NuGet Restore
41-
run: dotnet restore
42-
working-directory: src
43-
44-
- name: Build
45-
run: dotnet build --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
46-
working-directory: src
47-
48-
- uses: nuget/setup-nuget@v1
49-
name: Setup NuGet
50-
51-
- name: Pack
52-
run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore
53-
working-directory: src
54-
55-
# Decode the base 64 encoded pfx and save the Signing_Certificate
56-
- name: Sign NuGet packages
57-
shell: pwsh
58-
run: |
59-
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}")
60-
[IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte)
61-
$secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force
62-
Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My
63-
nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg
64-
65-
- name: Changelog
66-
uses: glennawatson/ChangeLog@v1
67-
id: changelog
68-
69-
- name: Create Release
70-
uses: actions/[email protected]
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
73-
with:
74-
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
75-
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
76-
body: |
77-
${{ steps.changelog.outputs.commitLog }}
78-
79-
- name: NuGet Push
80-
env:
81-
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
82-
SOURCE_URL: https://api.nuget.org/v3/index.json
83-
run: |
84-
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg
12+
uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main
13+
with:
14+
configuration: Release
15+
productNamespacePrefix: "Splat"
16+
useVisualStudioPreview: false
17+
useMauiCheckDotNetTool: false
18+
secrets:
19+
SIGN_CLIENT_USER_ID: ${{ secrets.SIGN_CLIENT_USER_ID }}
20+
SIGN_CLIENT_SECRET: ${{ secrets.SIGN_CLIENT_SECRET }}
21+
SIGN_CLIENT_CONFIG: ${{ secrets.SIGN_CLIENT_CONFIG }}
22+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)