Repository navigation
78 lines (65 loc) · 2.11 KB
/
Copy pathrelease-artifacts.yml
File metadata and controls
78 lines (65 loc) · 2.11 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
# Builds a release version on every supported OS and uploads the packages
# as artifacts of the release for verification/history. Upload waits for the whole matrix.
name: release-artifacts
on:
release:
types: [published]
defaults:
run:
shell: bash
jobs:
build:
name: build-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: ⚙ dotnet
uses: devlooped/actions-dotnet-env@v1
- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/}
- name: 🧪 test
run: dotnet test --no-build -m:1
- name: 📦 pack
run: dotnet pack -m:1 -bl:pack.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/}
- name: 🔼 logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.os }}
path: '**/*.binlog'
- name: 🔼 packages
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: bin-ubuntu-latest
path: bin/*.nupkg
release-artifacts:
needs: build
runs-on: ubuntu-latest
steps:
- name: 🏷 current
run: echo "CURRENT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: 🔽 packages
uses: actions/download-artifact@v4
with:
name: bin-ubuntu-latest
path: bin
- name: 🔽 gh
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
- name: 🔼 artifacts
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gci .\bin -Recurse -Filter *.nupkg | %{ gh release upload --clobber $env:CURRENT_TAG $_ }