Skip to content

Create release binary on version tag #5

Create release binary on version tag

Create release binary on version tag #5

Workflow file for this run

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
bin: soldr
- target: x86_64-unknown-linux-gnu
bin: soldr
name: ${{ matrix.platform.target }}
runs-on: ubuntu-latest
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: contains(matrix.platform.target, 'musl')
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.target }}
- name: Build UI
run: just install build-ui
- name: Build service
shell: bash
run: |
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: soldr-${{ matrix.platform.os_name }}
path: "soldr*"
if: startsWith( github.ref, 'refs/tags/v' )
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
draft: true
files: "soldr*"
body_path: Changes.md
if: startsWith( github.ref, 'refs/tags/v' )