-
Notifications
You must be signed in to change notification settings - Fork 60
85 lines (80 loc) · 3.02 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
84
85
name: Release desktop binaries
on:
workflow_dispatch:
inputs:
release-tag:
description: 'Version number to build and release'
required: true
jobs:
build-package:
name: Build self-contained executables
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet/sdk:8.0
strategy:
matrix:
include:
- platform: windows
platform-short: win
runtime: win-x64
- platform: windows
platform-short: win
runtime: win-arm64
- platform: mac
platform-short: mac
runtime: osx-x64
- platform: mac
platform-short: mac
runtime: osx-arm64
- platform: linux
platform-short: linux
runtime: linux-x64
- platform: linux
platform-short: linux
runtime: linux-arm64
steps:
- name: Check .NET version
run: dotnet --version
- name: Checkout source code
uses: actions/checkout@v3
- name: Execute Action build-with-plugins ${{ matrix.runtime }}
uses: ./.github/actions/build-with-plugins
with:
platform: ${{ matrix.platform }}
platform-short: ${{ matrix.platform-short }}
runtime: ${{ matrix.runtime }}
build-version: ${{ inputs.release-tag }}
create-release:
name: Create GitHub release
runs-on: ubuntu-latest
needs: build-package
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Package output files
run: |
zip -r dmt-${{ inputs.release-tag }}-win-x64.zip win-x64-package/*
zip -r dmt-${{ inputs.release-tag }}-win-arm64.zip win-arm64-package/*
# rename from osx to mac to retain previous naming convention
mv osx-x64-package mac-x64-package
zip -r dmt-${{ inputs.release-tag }}-mac-x64.zip mac-x64-package/*
# rename from osx to mac to retain previous naming convention
mv osx-arm64-package mac-arm64-package
zip -r dmt-${{ inputs.release-tag }}-mac-arm64.zip mac-arm64-package/*
# create linux packages using tar as supposed to zip. tar is more common for linux packages
tar -czvf dmt-${{ inputs.release-tag }}-linux-x64.tar.gz linux-x64-package/*
tar -czvf dmt-${{ inputs.release-tag }}-linux-arm64.tar.gz linux-arm64-package/*
- name: Create GitHub release ${{ inputs.release-tag }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.release-tag }}
files: |
dmt-${{ inputs.release-tag }}-win-x64.zip
dmt-${{ inputs.release-tag }}-win-arm64.zip
dmt-${{ inputs.release-tag }}-mac-x64.zip
dmt-${{ inputs.release-tag }}-mac-arm64.zip
dmt-${{ inputs.release-tag }}-linux-x64.tar.gz
dmt-${{ inputs.release-tag }}-linux-arm64.tar.gz