-
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.
- Loading branch information
1 parent
be4b7d0
commit d9c49c8
Showing
1 changed file
with
76 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Publish CLI | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
build: | ||
|
||
strategy: | ||
matrix: | ||
os: [ { os: windows-latest, runtime: win-x64 }, { os: ubuntu-latest, runtime: linux-x64 } ] | ||
|
||
runs-on: ${{ matrix.os.os }} | ||
|
||
name: Publish on ${{ matrix.os.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Publish ${{ matrix.os.runtime }} | ||
run: dotnet publish GhostToClipCLI -c Release -f net7.0 -r ${{ matrix.os.runtime }} -o build/GhostToClipCLI-${{ matrix.os.runtime }} -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:PublishTrimmed=true --self-contained | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v3.1.0 | ||
with: | ||
name: build | ||
path: build | ||
|
||
publish: | ||
needs: build | ||
|
||
strategy: | ||
matrix: | ||
os: [ { os: windows-latest, runtime: win-x64 }, { os: ubuntu-latest, runtime: linux-x64 } ] | ||
|
||
runs-on: ${{ matrix.os.os }} | ||
|
||
steps: | ||
- name: Download a Build Artifact | ||
uses: actions/download-artifact@v3.0.0 | ||
with: | ||
name: build | ||
|
||
- name: Zip to GhostToClipCLI-${{ matrix.os.runtime }}.${{ github.ref_name }}.zip | ||
uses: thedoctor0/zip-release@main | ||
with: | ||
path: GhostToClipCLI-${{ matrix.os.runtime }} | ||
filename: GhostToClipCLI-${{ matrix.os.runtime }}.${{ github.ref_name }}.zip | ||
|
||
- name: SHA256 checksum | ||
uses: Huy-Ngo/gha-sha@v1.1.0 | ||
with: | ||
glob: GhostToClipCLI-${{ matrix.os.runtime }}.${{ github.ref_name }}.zip | ||
|
||
- name: Upload GhostToClipCLI-${{ matrix.os.runtime }}.${{ github.ref_name }}.zip to latest release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: GhostToClipCLI-${{ matrix.os.runtime }}.${{ github.ref_name }}.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
body: | | ||
${{ github.event.release.body }} | ||
The ZIP was automatically generated using the [publish workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). |