Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Add deb packaging

Add deb packaging #27

Workflow file for this run

---
name: Release binaries
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
setup:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v2
publish-cargo:
runs-on: self-hosted
needs: setup
steps:
- name: Set version
run: BUILD_VERSION="${{ github.ref_name }}" gawk -i inplace '/^version/ {sub(/^v/, "", ENVIRON["BUILD_VERSION"]); print "version = \"" ENVIRON["BUILD_VERSION"] "\""; next} 1' Cargo.toml
- name: Publish to cargo
run: cargo publish --allow-dirty --token ${{ secrets.CARGO_LOGIN }}
build-and-bundle-binaries:
needs: setup
runs-on: self-hosted
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
steps:
- name: Build ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}
- name: Bundle ${{ matrix.target }}
run: ./.github/compress.sh "target/${{ matrix.target }}/release" "rusty-belt-${{ github.ref_name }}-${{ matrix.target }}"
- name: Bundle ${{ matrix.target }} deb
run: TARGET="${{ matrix.target }}" VERSION="${{github.ref_name}}" ./.github/deb_build.sh ${TARGET%%-*} "target/${{ matrix.target }}/release" ${VERSION#v}
if: ${{ contains(matrix.target, 'linux-musl') }}
publish-to-release:
runs-on: self-hosted
needs: build-and-bundle-binaries
steps:
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rusty-belt-${{github.ref_name}}-x86_64-apple-darwin.zip
rusty-belt-${{github.ref_name}}-aarch64-apple-darwin.zip
rusty-belt-${{github.ref_name}}-x86_64-unknown-linux-musl.tar.gz
rusty-belt-${{github.ref_name}}-aarch64-unknown-linux-musl.tar.gz
rusty-belt-aarch64-${{github.ref_name}}.deb
rusty-belt-x86_64-${{github.ref_name}}.deb