Skip to content

Commit

Permalink
Improve release
Browse files Browse the repository at this point in the history
  • Loading branch information
jkfran committed Mar 19, 2023
1 parent 3348750 commit 30c7d28
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ on:

jobs:
release:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- arm-unknown-linux-gnueabihf
- powerpc64le-unknown-linux-gnu
- s390x-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -19,13 +29,22 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Install cargo-deb
run: cargo install cargo-deb
- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}

- name: Build deb package
run: cargo deb
- name: Package binaries
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../killport-${{ matrix.target }}.tar.gz killport
cd -
- name: Extract version from Cargo.toml
id: get_version
Expand Down Expand Up @@ -66,6 +85,6 @@ jobs:
with:
tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
files: target/debian/killport_${{ env.VERSION }}_amd64.deb
files: 'killport*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ assets = [
["README.md", "usr/share/doc/killport/", "644"],
["LICENSE", "usr/share/doc/killport/", "644"],
]

[target.aarch64-unknown-linux-gnu]
# Update the path to the binary for arm64 build
deb.output = "target/debian/killport_${{ env.VERSION }}_arm64.deb"

0 comments on commit 30c7d28

Please sign in to comment.