-
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.
chore(gitflow): build release ci yml; cog init
- Loading branch information
Showing
3 changed files
with
118 additions
and
72 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,54 @@ | ||
# release ci: build linux binaries and attach to release with SHA256 | ||
|
||
name: build and release | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [ created ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
|
||
build: | ||
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }} | ||
runs-on: ${{ matrix.platform.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- os_name: Linux-aarch64 | ||
os: ubuntu-20.04 | ||
target: aarch64-unknown-linux-musl | ||
bin: cerebro-${{ github.event.release.tag_name }}-linux-arm64 # semver release tag | ||
- os_name: Linux-x86_64 | ||
os: ubuntu-20.04 | ||
target: x86_64-unknown-linux-gnu | ||
bin: cerebro-${{ github.event.release.tag_name }}-linux-amd64 # semver release tag | ||
toolchain: | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build binary | ||
uses: houseabsolute/actions-rust-cross@v0 | ||
with: | ||
command: "build" | ||
target: ${{ matrix.platform.target }} | ||
toolchain: ${{ matrix.toolchain }} | ||
args: "--locked --release" | ||
strip: true | ||
- name: Rename binary (linux and macos) | ||
run: mv target/${{ matrix.platform.target }}/release/cerebro target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | ||
if: matrix.platform.os_name != 'Windows-x86_64' | ||
- name: Generate SHA-256 of uncompressed binary | ||
run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256 | ||
- name: Compress binary and package files | ||
run: tar -cJf target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.tar.xz target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | ||
- name: Release binary and SHA-256 checksum to GitHub | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.tar.xz | ||
target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256 |
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