Skip to content

Commit

Permalink
gh-actions: Run the release process on GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zachfeldman committed Oct 9, 2023
1 parent 440b669 commit 2b678b1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <support@frame.work>" \
--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 <pkg-name>.deb"'

0 comments on commit 2b678b1

Please sign in to comment.