Create release binary on version tag #10
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/soldr/blob/master/.github/workflows/ci.yml | |
artifacts: | |
strategy: | |
matrix: | |
platform: | |
- target: x86_64-unknown-linux-musl | |
- target: x86_64-unknown-linux-gnu | |
name: ${{ matrix.platform.target }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
- uses: extractions/setup-just@v1 | |
- name: Install musl-tools on Linux | |
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools | |
if: matrix.platform.target == 'x86_64-unknown-linux-musl' | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.platform.target }} | |
- name: Build UI | |
shell: bash | |
run: | | |
just install build-ui | |
cargo build --bin soldr-ui --locked --release --target ${{ matrix.platform.target }} | |
- name: Build proxy | |
shell: bash | |
run: | | |
cargo build --bin soldr --locked --release --target ${{ matrix.platform.target }} | |
- name: Strip binaries | |
shell: bash | |
run: | | |
strip target/${{ matrix.platform.target }}/release/soldr{,-ui} | |
- name: Package as archive | |
shell: bash | |
run: | | |
cd target/${{ matrix.platform.target }}/release | |
tar czvf ../../../${{ matrix.platform.target }}.tar.gz soldr{,-ui} | |
cd - | |
- name: Publish release artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: soldr-${{ matrix.platform.target }} | |
path: "soldr*" | |
if: startsWith( github.ref, 'refs/tags/v' ) | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: "soldr*" | |
if: startsWith( github.ref, 'refs/tags/v' ) |