-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c881893
commit 4ec3d3b
Showing
2 changed files
with
75 additions
and
1 deletion.
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,74 @@ | ||
name: Publish Release from Tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*-beta*" | ||
- "*.*.*-rc*" | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build release artifacts | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
targets: | ||
[ | ||
"linux-x64", | ||
"linux-musl-x64", | ||
"linux-arm", | ||
"linux-arm64", | ||
"osx-x64", | ||
"win-x64", | ||
"win-x86", | ||
"win-arm", | ||
"win-arm64", | ||
] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: "6.0.x" | ||
- name: Publish .NET app | ||
env: | ||
RID: ${{ matrix.targets }} | ||
VERSION: ${{ github.ref_name }} | ||
run: dotnet publish -c Release -r $RID --self-contained true -p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true CliSample/CliSample.csproj --output /home/runner/work/clis/$RID | ||
- name: Package assets | ||
env: | ||
RID: ${{ matrix.targets }} | ||
VERSION: ${{ github.ref_name }} | ||
run: | | ||
mkdir /home/runner/work/release | ||
ls /home/runner/work/clis/ | ||
zip -j /home/runner/work/release/clisample-$VERSION-$RID.zip /home/runner/work/clis/$RID/* | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: clisample-${{ github.ref_name }}-${{ matrix.targets }}.zip | ||
path: "/home/runner/work/release/clisample-${{ github.ref_name }}-${{ matrix.targets }}.zip" | ||
|
||
publish: | ||
name: Publish release | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Create .artifacts dir | ||
run: mkdir .artifacts | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: .artifacts | ||
- name: Generate Changelog | ||
run: git log --pretty="format:[%h] %s" $(git describe --tags --abbrev=0 @^)..@ > .artifacts/CHANGELOG.txt | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
prerelease: true | ||
files: .artifacts/** | ||
body_path: .artifacts/CHANGELOG.txt |