From 55353760fd8d8b9aeb4007b8df5a8680dc9b8520 Mon Sep 17 00:00:00 2001 From: Zach Feldman Date: Tue, 13 Jun 2023 07:50:41 -0400 Subject: [PATCH] gh-actions: Run the release process on GitHub actions --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ release/release.sh | 8 ++++---- 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4beed15 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Create Releases +on: + push: + # Eventually run this only on release branches + # branches: + # - 'releases/**' + +env: + CARGO_TERM_COLOR: always + CARGO_NET_GIT_FETCH_WITH_CLI: true + +jobs: + release-linux: + name: Release Linux + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libudev-dev libasound2-dev + + - name: Setup Rust toolchain + run: rustup show + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + + - name: Build Linux tool and create deb + run: ./release/release.sh + + - name: Upload Linux deb + uses: actions/upload-artifact@v3 + with: + name: framework-inputmodule-rs-0.0.1.deb + path: release/framework-inputmodule-rs-0.0.1.deb diff --git a/release/release.sh b/release/release.sh index ce8ba2e..9fa7bf8 100755 --- a/release/release.sh +++ b/release/release.sh @@ -10,23 +10,23 @@ if [ $installed = 'false' ]; then fi : 'Running the build' -cargo build +cargo build --target x86_64-unknown-linux-gnu -p inputmodule-control : "Packaging" fpm \ -s dir -t deb \ - -p framework-inputmodule-rs-0.0.1.deb \ + -p release/framework-inputmodule-rs-0.0.1.deb \ --name framework-inputmodule-rs \ --version 0.0.1 \ --architecture all \ --description "framework-inputmodule-rs runs Framework Laptop 16 input modules and keeps their firmware up to date" \ --url "https://frame.work" \ --maintainer "Framework " \ - --deb-systemd ./framework-inputmodule-rs.service \ + --deb-systemd ./release/framework-inputmodule-rs.service \ --deb-systemd-enable \ --deb-systemd-auto-start \ --deb-systemd-restart-after-upgrade \ - --after-install postinstall.sh \ + --after-install ./release/postinstall.sh \ target/x86_64-unknown-linux-gnu/debug/inputmodule-control=/usr/bin/framework-inputmodule-rs : 'Packaging successful, install with "sudo dpkg -i .deb"'