-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (63 loc) · 2.58 KB
/
release.yml
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
name: Release
on:
push:
branches:
- main
jobs:
draft_release:
name: Draft new release
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.project_version.outputs.TAG }}
steps:
- name: Fetch source code
uses: actions/checkout@v3
- name: Install XML tools
run: sudo apt install xmlstarlet
- name: Fetch version string
run: echo "TAG=$(xmlstarlet select --template --value-of /Project/PropertyGroup/AssemblyVersion ./src/TYM.csproj)" >> $GITHUB_OUTPUT
id: project_version
- name: Draft release
uses: softprops/action-gh-release@v1
id: draft
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
with:
tag_name: ${{ steps.project_version.outputs.TAG }}
name: TYM v${{ steps.project_version.outputs.TAG }}
draft: true
prerelease: false
body_path: CHANGELOG.md
build_artifacts:
name: Build release assets
runs-on: ${{ matrix.os }}
needs: draft_release
strategy:
matrix:
include:
- os: windows-latest
target: win
bin-extension: ".exe"
- os: ubuntu-latest
target: linux
bin-extension: ""
- os: macos-latest
target: osx
bin-extension: ""
steps:
- name: Fetch source code
uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Build
run: dotnet build src/TYM.csproj
- name: Publish
run: dotnet publish src/TYM.csproj -a x64 --os ${{ matrix.target }} -c Release -p:PublishProfile=Properties/PublishProfiles/PublishConfig.pubxml
- name: Rename output files
run: mv src/pub/TYM${{ matrix.bin-extension }} TYM-${{ needs.draft_release.outputs.release_tag }}-${{ matrix.target }}-bin${{ matrix.bin-extension }}
- name: Upload artifact
run: gh release upload ${{ needs.draft_release.outputs.release_tag }} TYM-${{ needs.draft_release.outputs.release_tag }}-${{ matrix.target }}-bin${{ matrix.bin-extension }}
env:
GH_TOKEN: ${{ secrets.G_TOKEN }}