-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (85 loc) · 3.05 KB
/
release.yml
File metadata and controls
88 lines (85 loc) · 3.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
82
83
84
85
86
87
88
name: Release
on:
push:
tags: ['v*']
jobs:
build-native:
strategy:
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
- os: macos-latest
rid: osx-arm64
- os: windows-latest
rid: win-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '10.0.x'
- name: Set version from tag
shell: bash
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Publish git-pull-all
run: >
dotnet publish src/git-pull-all/git-pull-all.csproj
-c Release
-r ${{ matrix.rid }}
-p:Version=${{ env.VERSION }}
-p:PublishAot=true
-o ./publish/git-pull-all
- name: Publish git-fetch-all
run: >
dotnet publish src/git-fetch-all/git-fetch-all.csproj
-c Release
-r ${{ matrix.rid }}
-p:Version=${{ env.VERSION }}
-p:PublishAot=true
-o ./publish/git-fetch-all
- name: Upload git-pull-all
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: git-pull-all-${{ matrix.rid }}
path: ./publish/git-pull-all/git-pull-all*
- name: Upload git-fetch-all
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: git-fetch-all-${{ matrix.rid }}
path: ./publish/git-fetch-all/git-fetch-all*
release:
needs: build-native
runs-on: ubuntu-latest
environment: nuget
permissions:
contents: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '10.0.x'
- name: Set version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- run: dotnet restore
- run: dotnet build --no-restore -c Release -p:Version=${{ env.VERSION }}
- run: dotnet test --no-build -c Release
- run: dotnet pack --no-build -c Release -p:Version=${{ env.VERSION }} -o ./artifacts
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Download native binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: ./native
- name: Package native binaries
run: |
cd native
for dir in */; do
name="${dir%/}"
tar -czf "../artifacts/${name}.tar.gz" -C "$dir" .
done
- name: Create GitHub Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
files: artifacts/*
generate_release_notes: true