Skip to content

Commit bcc398c

Browse files
committed
Adding release build action
1 parent 1a65784 commit bcc398c

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
release:
8+
name: Release
9+
strategy:
10+
matrix:
11+
kind: ['linux', 'windows', 'macOS']
12+
include:
13+
- kind: linux
14+
os: ubuntu-latest
15+
target: linux-x64
16+
- kind: windows
17+
os: windows-latest
18+
target: win-x64
19+
- kind: macOS
20+
os: macos-latest
21+
target: osx-x64
22+
runs-on: ${{ matrix.os }}
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v1
27+
28+
- name: Setup dotnet
29+
uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: 3.1.407
32+
33+
- name: Build
34+
shell: bash
35+
run: |
36+
# Define some variables for things we need
37+
tag=$(git describe --tags --abbrev=0)
38+
release_name="fhir-codegen-$tag-${{ matrix.target }}"
39+
40+
# Build everything
41+
dotnet publish src/fhir-codegen-cli/fhir-codegen-cli.csproj --framework netcoreapp3.1 --runtime "${{ matrix.target }}" -c Release -o "$release_name"
42+
43+
# Pack files
44+
if [ "${{ matrix.target }}" == "win-x64" ]; then
45+
7z a -tzip "${release_name}.zip" "./${release_name}/*"
46+
else
47+
tar czvf "${release_name}.tar.gz" "$release_name"
48+
fi
49+
50+
# Delete output directory
51+
rm -r "$release_name"
52+
53+
- name: Publish
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
files: "fhir-codegen*"
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

fhir-codegen.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
GeoPol.xml = GeoPol.xml
1212
LICENSE = LICENSE
1313
README.md = README.md
14+
.github\workflows\ReleasePublish.yaml = .github\workflows\ReleasePublish.yaml
1415
SECURITY.md = SECURITY.md
1516
stylecop.json = stylecop.json
1617
THIRDPARTYNOTICES.md = THIRDPARTYNOTICES.md

0 commit comments

Comments
 (0)