Skip to content

Commit

Permalink
Add workflow to build distribution packages on release
Browse files Browse the repository at this point in the history
  • Loading branch information
hisbaan committed Feb 6, 2024
1 parent d477409 commit d85b12f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build-package
on:
release:
types: [published]
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTUP_TOOLCHAIN: stable
CARGO_TARGET_DIR: target
PLATFORM: ${{ matrix.os == 'macos-latest' && 'apple-darwin' || 'linux-gnu' }}
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: cargo build --locked --release
- name: Strip binary
run: strip target/release/dym
- name: Move the binary
run: cp target/release/dym .
- name: Create TAR package
run: tar -czvf dym-$(target/release/dym --version | cut -d ' ' -f 2)-x86_64-${PLATFORM}.tar.gz completions docs man dym
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dym-$(target/release/dym --version | cut -d ' ' -f 2)-x86_64-${PLATFORM}.tar.gz

0 comments on commit d85b12f

Please sign in to comment.