-
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.
Build binaries when we make a release tag, and publish those on a github release. This will let people without github accounts download and use the CLI, currently workflow artifacts are only available to logged-in users: actions/upload-artifact#51 Also fixes a bug in the binary CI to actually make one-file binaries instead of 256 `dll`s.
- Loading branch information
Showing
3 changed files
with
58 additions
and
24 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,58 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
APP: "./src/XlsxCompare" | ||
|
||
jobs: | ||
verify_commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Verify commit exists in origin/main | ||
run: | | ||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | ||
git branch --remote --contains | grep origin/main | ||
binaries: | ||
needs: verify_commit | ||
runs-on: ubuntu-latest | ||
name: create standalone binaries | ||
strategy: | ||
matrix: | ||
rid: | ||
- win-x64 | ||
- linux-x64 | ||
- osx-x64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: "5.0.x" | ||
- name: Create the self-contained binary | ||
run: dotnet publish --configuration Release "${APP}" -r ${{ matrix.rid }} -o out/${{ matrix.rid }} --self-contained true | ||
- name: rename so the release can have a flat list of files | ||
run: cp out/${{ matrix.rid }}/XlsxCompare XlsxCompare-${{ matrix.rid }} || cp out/${{ matrix.rid }}/XlsxCompare.exe XlsxCompare-${{ matrix.rid }}.exe | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.rid }} binary | ||
path: XlsxCompare* | ||
|
||
release: | ||
needs: binaries | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: download all binaries | ||
uses: actions/download-artifact@v2 | ||
- uses: "marvinpinto/[email protected]" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
**/XlsxCompare* |
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