-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (32 loc) · 1.31 KB
/
build-canary.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Build Canary
on:
workflow_dispatch:
jobs:
build-dotnet:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Load secrets
id: op-load-secret
uses: 1password/load-secrets-action@v2
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
NUGET_KEY: "op://GitHubActionsPublic/NUGET_KEY/username"
- uses: actions/checkout@v4
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- name: "Set VersionSuffix for Preview"
id: version-suffix
run: echo "version=preview.`date '+%Y%m%d-%H%M%S'`+${GITHUB_SHA:0:6}" | tee -a $GITHUB_OUTPUT
- run: dotnet build -c Release
# .csproj included version will be used.
- run: dotnet pack -c Release --no-build --version-suffix "${{ steps.version-suffix.outputs.verseion }}" --include-symbols --include-source -o ./publish
# Upload & Publish
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
with:
name: nuget
path: ./publish
retention-days: 14
- name: "Push to NuGet.org"
run: dotnet nuget push "$GITHUB_WORKSPACE/publish/*.nupkg" --skip-duplicate -k ${{ steps.op-load-secret.outputs.NUGET_KEY }} -s https://api.nuget.org/v3/index.json