Skip to content

Commit 54a594e

Browse files
committed
try push nuget
1 parent d074fc5 commit 54a594e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/push-nuget.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: push-native-nuget
2+
on:
3+
push:
4+
branches:
5+
- feature/docker
6+
paths:
7+
- .github/workflows/push-nuget.yml
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-all:
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
include:
16+
- { os: ubuntu.22.04, arch: x64, }
17+
- { os: ubuntu.22.04, arch: arm64, }
18+
- { os: win, arch: x64, }
19+
- { os: win, arch: x86, }
20+
- { os: win, arch: arm64, }
21+
- { os: osx, arch: x64, }
22+
- { os: osx, arch: arm64, }
23+
- { os: centos.7, arch: x64, }
24+
- { os: centos.7, arch: arm64, }
25+
- { os: linux, arch: x64, }
26+
- { os: linux, arch: arm64, }
27+
- { os: linux-musl, arch: x64, }
28+
- { os: linux-musl, arch: arm64, }
29+
- { os: android, arch: arm64, }
30+
- { os: android, arch: x64, }
31+
32+
steps:
33+
- name: Download Artifacts
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
run: |
37+
echo "Fetching latest successful run of branch ${{ github.ref_name }}"
38+
RUN_ID=$(gh run list -R ${{ github.repository }} \
39+
--workflow=make-nuget.yml \
40+
--branch=${{ github.ref_name }} \
41+
--status=success --limit=1 \
42+
--json databaseId | jq -r '.[0].databaseId')
43+
echo "Run id = $RUN_ID"
44+
45+
echo "Download artifact ${{ matrix.os }}-${{ matrix.arch }}"
46+
gh run download -R ${{ github.repository }} $RUN_ID --name nuget-${{ matrix.os }}-${{ matrix.arch }} --dir nupkg-src
47+
48+
echo "::group::Artifact tree"
49+
ls -lR nupkg-src
50+
echo "::endgroup::"
51+
52+
- name: Push nupkg to NuGet
53+
run: |
54+
for nupkg in nupkg-src/*.nupkg; do
55+
echo "Uploading $nupkg"
56+
echo dotnet nuget push "$nupkg" --source "nuget.org" --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
57+
done

0 commit comments

Comments
 (0)