-
Notifications
You must be signed in to change notification settings - Fork 53
55 lines (47 loc) · 1.57 KB
/
ReleasePublish.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
name: Publish
on:
release:
types: [published]
env:
DOTNET_VERSION: '8' # The .NET SDK version to use
jobs:
release:
name: Release-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build
shell: bash
run: |
# Define some variables for things we need
tag=$(git describe --tags --abbrev=0)
release_name="fhir-codegen-$tag-${{ matrix.target }}"
# Build everything
dotnet publish src/fhir-codegen-cli/fhir-codegen-cli.csproj --framework netcoreapp3.1 --runtime "${{ matrix.target }}" -c Release -o "$release_name"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
7z a -tzip "${release_name}.zip" "./${release_name}/*"
7z a -tzip "generated-${tag}.zip" -r "./generated/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
tar czvf "generated-${tag}.tar.gz" "generated"
fi
# Delete output directory
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: false
files: |
"fhir-codegen-*"
"generated-*.zip"
"generated-*.tar.gz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}