-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow: package and release on tag #8
- Loading branch information
Showing
2 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Publish release | ||
|
||
on: | ||
push: | ||
tags: [ "v*.*.*" ] | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
dotnet: [5.0.x] | ||
runtime: [linux-x64, win10-x64, osx.11.0-x64] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install tooling | ||
run: sudo apt-get install -qq zip | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet }} | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore | ||
|
||
- name: Test | ||
run: dotnet test --no-build --verbosity normal | ||
|
||
- name: Publish | ||
run: dotnet publish -r ${{ matrix.runtime }} -c Release -o ./out src/Cli/hashfields.csproj | ||
|
||
- name: Make artifact path | ||
id: make-path | ||
env: | ||
ref: ${{ github.ref }} | ||
runtime: ${{ matrix.runtime }} | ||
dotnet: ${{ matrix.dotnet }} | ||
run: | | ||
echo "::set-output name=path::hashfields-${ref/refs\/tags\//}-$runtime-dotnet-$dotnet.zip" | ||
- name: Zip | ||
env: | ||
path: ${{ steps.make-path.outputs.path }} | ||
run: | | ||
zip -r -j $path out/ | ||
ls -l $path | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: package | ||
path: ${{ steps.make-path.outputs.path }} | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: package | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: package | ||
path: ./package | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "./package/*.zip" |