-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (70 loc) · 2.64 KB
/
release_unstable.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
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
name: Publish PRE Release from Tag
on:
push:
tags:
- "*.*.*-beta*"
- "*.*.*-rc*"
jobs:
build:
name: Build release artifacts
runs-on: ubuntu-latest
strategy:
matrix:
targets:
[
"linux-x64",
"linux-musl-x64",
"linux-arm",
"linux-arm64",
"osx-x64",
"win-x64",
"win-x86",
"win-arm",
"win-arm64",
]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"
- name: Publish .NET app
env:
RID: ${{ matrix.targets }}
VERSION: ${{ github.ref_name }}
run: dotnet publish -c Release -r $RID --self-contained true -p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true CliSample/CliSample.csproj --output /home/runner/work/clis/$RID
- name: Package assets
env:
RID: ${{ matrix.targets }}
VERSION: ${{ github.ref_name }}
run: |
mkdir /home/runner/work/release
ls /home/runner/work/clis/
zip -j /home/runner/work/release/clisample-$VERSION-$RID.zip /home/runner/work/clis/$RID/*
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: clisample-${{ github.ref_name }}-${{ matrix.targets }}.zip
path: "/home/runner/work/release/clisample-${{ github.ref_name }}-${{ matrix.targets }}.zip"
publish:
name: Publish release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Create .artifacts dir
run: mkdir .artifacts
- uses: actions/download-artifact@v2
with:
path: .artifacts
- name: Generate Changelog
run: git log --pretty="format:[%h] %s" $(git describe --tags --abbrev=0 @^)..@ > .artifacts/CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
files: .artifacts/**
body_path: .artifacts/CHANGELOG.txt