Skip to content

Commit

Permalink
Fix for QEMU
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Jul 3, 2024
1 parent fa771dd commit 59214d9
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: ubuntu-latest
arch: [x86_64, aarch64]
arch: x86_64
- os: ubuntu-latest
arch: aarch64
- os: macOS-latest
- os: windows-latest

runs-on: ${{ matrix.os }}
env:
Expand All @@ -47,7 +50,11 @@ jobs:

- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libssl-dev libasound2-dev
run: |
sudo apt-get update && sudo apt-get install -y libgtk-3-dev libssl-dev libasound2-dev
if [ "${{ matrix.arch }}" == "aarch64" ]; then
sudo apt-get install -y qemu-user-static gcc-aarch64-linux-gnu
fi
- name: Run Tests
run: cargo test
Expand All @@ -62,6 +69,9 @@ jobs:
run: |
rustup target add aarch64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER: qemu-aarch64-static

- name: Build Release (macOS)
if: runner.os == 'macOS'
Expand Down Expand Up @@ -129,18 +139,27 @@ jobs:
deb:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Download Linux Binary
- name: Download Linux Binaries
uses: actions/download-artifact@v4
with:
name: psst-gui
path: ${{runner.workspace}}
path: ${{runner.workspace}}/binaries

- name: Move Binary
run: mkdir -p ${{runner.workspace}}/pkg/usr/bin/; mv ${{runner.workspace}}/psst-gui $_
run: |
mkdir -p ${{runner.workspace}}/pkg/usr/bin/
if [ "${{ matrix.arch }}" == "amd64" ]; then
mv ${{runner.workspace}}/binaries/x86_64-unknown-linux-gnu/release/psst-gui ${{runner.workspace}}/pkg/usr/bin/
else
mv ${{runner.workspace}}/binaries/aarch64-unknown-linux-gnu/release/psst-gui ${{runner.workspace}}/pkg/usr/bin/
fi
- name: Move Desktop Entry
run: mkdir -p ${{runner.workspace}}/pkg/usr/share/applications/; mv .pkg/psst.desktop $_
Expand All @@ -164,18 +183,23 @@ jobs:
run: mkdir -p ${{runner.workspace}}/pkg/usr/share/doc/psst-gui/; mv .pkg/copyright $_

- name: Move Package Config
run: mkdir -p ${{runner.workspace}}/pkg/; mv .pkg/DEBIAN $_/
run: |
mkdir -p ${{runner.workspace}}/pkg/
cp -r .pkg/DEBIAN $_/
sed -i 's/Architecture: amd64/Architecture: ${{ matrix.arch }}/' ${{runner.workspace}}/pkg/DEBIAN/control
- name: Set Version
run: "echo Version: $(git rev-list --count HEAD) >> ${{runner.workspace}}/pkg/DEBIAN/control"

- name: Build Package
run: cat ${{runner.workspace}}/pkg/DEBIAN/control && dpkg-deb -b ${{runner.workspace}}/pkg/ psst_$(git rev-list --count HEAD)_amd64.deb
run: |
cat ${{runner.workspace}}/pkg/DEBIAN/control
dpkg-deb -b ${{runner.workspace}}/pkg/ psst_$(git rev-list --count HEAD)_${{ matrix.arch }}.deb
- name: Upload Debian Package
uses: actions/upload-artifact@v4
with:
name: psst-deb
name: psst-deb-${{ matrix.arch }}
path: "*.deb"

appimage:
Expand Down

0 comments on commit 59214d9

Please sign in to comment.