-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (71 loc) · 2.05 KB
/
release.yml
File metadata and controls
81 lines (71 loc) · 2.05 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release NuGet Packages
on:
push:
tags:
- 'v*'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Pack solution
env:
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
set -euo pipefail
dotnet pack DataProvider.sln -c Release -p:Version="$VERSION" -o ./nupkgs
- name: Push packages to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
set -euo pipefail
if [ -z "${NUGET_API_KEY:-}" ]; then
echo "NUGET_API_KEY secret is not set." >&2
exit 1
fi
shopt -s nullglob
packages=(./nupkgs/*.nupkg)
if [ ${#packages[@]} -eq 0 ]; then
echo "No packages produced — failing." >&2
exit 1
fi
for pkg in "${packages[@]}"; do
echo "::group::Push $pkg"
dotnet nuget push "$pkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
echo "::endgroup::"
done
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" --generate-notes
deploy-lql-website:
needs: publish
uses: ./.github/workflows/deploy-lql-website.yml
permissions:
contents: read
pages: write
id-token: write
deploy-website:
needs: deploy-lql-website
uses: ./.github/workflows/deploy-website.yml
secrets: inherit
permissions:
contents: read
pages: write
id-token: write