Skip to content

Commit

Permalink
Merge pull request #64 from hjr3/release-builds
Browse files Browse the repository at this point in the history
Create release binary on version tag
  • Loading branch information
hjr3 authored Jan 27, 2024
2 parents 323f49c + 0fb70cc commit 26bb5e1
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 218 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: extractions/setup-just@v1
- run: just install build-ui
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pr-audit.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Pull Request Security Audit

on:
push:
paths:
- '**/Cargo.toml'
pull_request:
paths:
- '**/Cargo.toml'
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Binaries

on:
push:
tags:
- "v*.*.*"

env:
CARGO_TERM_COLOR: always

jobs:
# based off of https://github.com/houseabsolute/soldr/blob/master/.github/workflows/ci.yml
artifacts:
permissions:
contents: write
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: ${{ matrix.platform.target }}.tar.gz
if: startsWith( github.ref, 'refs/tags/v' )
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
draft: true
files: ${{ matrix.platform.target }}.tar.gz
if: startsWith( github.ref, 'refs/tags/v' )
Loading

0 comments on commit 26bb5e1

Please sign in to comment.