Skip to content

Commit

Permalink
Adding release build action
Browse files Browse the repository at this point in the history
  • Loading branch information
GinoCanessa committed Apr 6, 2021
1 parent 1a65784 commit bcc398c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ReleasePublish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish
on:
release:
types: [published]

jobs:
release:
name: Release
strategy:
matrix:
kind: ['linux', 'windows', 'macOS']
include:
- kind: linux
os: ubuntu-latest
target: linux-x64
- kind: windows
os: windows-latest
target: win-x64
- kind: macOS
os: macos-latest
target: osx-x64
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.407

- 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}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
# Delete output directory
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "fhir-codegen*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions fhir-codegen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
GeoPol.xml = GeoPol.xml
LICENSE = LICENSE
README.md = README.md
.github\workflows\ReleasePublish.yaml = .github\workflows\ReleasePublish.yaml
SECURITY.md = SECURITY.md
stylecop.json = stylecop.json
THIRDPARTYNOTICES.md = THIRDPARTYNOTICES.md
Expand Down

0 comments on commit bcc398c

Please sign in to comment.