Create release binary on version tag #2
Workflow file for this run
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
name: Build Binaries | |
on: [pull_request] | |
#on: | |
# release: | |
# types: # This configuration does not affect the page_build event above | |
# - created | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# based off of https://github.com/houseabsolute/ubi/blob/master/.github/workflows/ci.yml | |
artifacts: | |
strategy: | |
matrix: | |
platform: | |
- target: x86_64-unknown-linux-musl | |
bin: soldr | |
- target: x86_64-unknown-linux-gnu | |
bin: soldr | |
name: MUSL binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.platform.target }} | |
- name: Build | |
shell: bash | |
run: | | |
ls -la | |
cargo build --locked --release --target ${{ matrix.platform.target }} | |
- name: Strip binary | |
shell: bash | |
run: | | |
strip target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | |
- name: Package as archive | |
shell: bash | |
run: | | |
cd target/${{ matrix.platform.target }}/release | |
tar czvf ../../../${{ matrix.platform.target }}.tar.gz ${{ matrix.platform.bin }} | |
cd - | |
- name: Publish release artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ubi-${{ matrix.platform.os_name }} | |
path: "ubi*" | |
if: startsWith( github.ref, 'refs/tags/v' ) | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: "ubi*" | |
body_path: Changes.md | |
if: startsWith( github.ref, 'refs/tags/v' ) |