Skip to content

Commit af0fbb9

Browse files
committed
Add RPM and AUR packaging support
- Stage shared Linux package inputs - Build and publish RPM artifacts and AUR package files - Update docs and download script for new release assets
1 parent f2bf31b commit af0fbb9

8 files changed

Lines changed: 614 additions & 66 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,35 @@ jobs:
2222
artifact: playit-linux-amd64
2323
artifact_cli: playit-cli-linux-amd64
2424
dpkg_arch: amd64
25+
rpm_arch: x86_64
26+
aur_arch: x86_64
2527

2628
- name: linux arm64
2729
os: ubuntu-latest
2830
arch: aarch64-unknown-linux-musl
2931
artifact: playit-linux-aarch64
3032
artifact_cli: playit-cli-linux-aarch64
3133
dpkg_arch: arm64
34+
rpm_arch: aarch64
35+
aur_arch: aarch64
3236

3337
- name: linux arm7
3438
os: ubuntu-latest
3539
arch: armv7-unknown-linux-gnueabihf
3640
artifact: playit-linux-armv7
3741
artifact_cli: playit-cli-linux-armv7
3842
dpkg_arch: armhf
43+
rpm_arch: armv7hl
44+
aur_arch: armv7h
3945

4046
- name: linux 32bit
4147
os: ubuntu-latest
4248
arch: i686-unknown-linux-gnu
4349
artifact: playit-linux-i686
4450
artifact_cli: playit-cli-linux-i686
4551
dpkg_arch: i386
52+
rpm_arch: i686
53+
aur_arch: i686
4654

4755
runs-on: ${{ matrix.platform.os }}
4856
steps:
@@ -54,6 +62,13 @@ jobs:
5462
env:
5563
GITHUB_TOKEN: ${{ github.token }}
5664

65+
- name: Install RPM packaging tools
66+
shell: bash
67+
run: |
68+
sudo apt-get update
69+
sudo apt-get install -y rpm
70+
sudo gem install --no-document fpm
71+
5772
- name: build release
5873
uses: actions-rs/cargo@v1
5974
with:
@@ -81,6 +96,19 @@ jobs:
8196
asset_name: ${{ matrix.platform.artifact_cli }}
8297
asset_content_type: application/octet-stream
8398

99+
- name: Collect AUR inputs
100+
shell: bash
101+
run: |
102+
mkdir -p ./target/aur-inputs
103+
cp "./target/${{ matrix.platform.arch }}/release/playitd" "./target/aur-inputs/${{ matrix.platform.artifact }}"
104+
cp "./target/${{ matrix.platform.arch }}/release/playit-cli" "./target/aur-inputs/${{ matrix.platform.artifact_cli }}"
105+
106+
- name: Upload AUR inputs
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: linux-aur-inputs-${{ matrix.platform.aur_arch }}
110+
path: ./target/aur-inputs/*
111+
84112
- name: Package .deb
85113
shell: bash
86114
run: 'bash ./build-scripts/package-linux-deb.sh "./target/${{ matrix.platform.arch }}/release/playit-cli" "./target/${{ matrix.platform.arch }}/release/playitd" ${{ matrix.platform.dpkg_arch }}'
@@ -94,6 +122,57 @@ jobs:
94122
asset_path: ./target/deb/playit_${{ matrix.platform.dpkg_arch }}.deb
95123
asset_name: playit_${{ matrix.platform.dpkg_arch }}.deb
96124
asset_content_type: application/octet-stream
125+
126+
- name: Package .rpm
127+
shell: bash
128+
run: 'bash ./build-scripts/package-linux-rpm.sh "./target/${{ matrix.platform.arch }}/release/playit-cli" "./target/${{ matrix.platform.arch }}/release/playitd" ${{ matrix.platform.rpm_arch }}'
129+
130+
- name: Upload .rpm
131+
uses: actions/upload-release-asset@v1
132+
env:
133+
GITHUB_TOKEN: ${{ github.token }}
134+
with:
135+
upload_url: ${{ steps.get_release.outputs.upload_url }}
136+
asset_path: ./target/rpm/playit_${{ matrix.platform.rpm_arch }}.rpm
137+
asset_name: playit_${{ matrix.platform.rpm_arch }}.rpm
138+
asset_content_type: application/x-rpm
139+
140+
build_arch_aur:
141+
runs-on: ubuntu-latest
142+
needs: [build_linux]
143+
steps:
144+
- uses: actions/checkout@v3
145+
146+
- name: Get release
147+
id: get_release
148+
uses: bruceadams/[email protected]
149+
env:
150+
GITHUB_TOKEN: ${{ github.token }}
151+
152+
- name: Download Linux release binaries
153+
uses: actions/download-artifact@v4
154+
with:
155+
pattern: linux-aur-inputs-*
156+
merge-multiple: true
157+
path: ./target/aur-inputs
158+
159+
- name: Generate AUR package files
160+
shell: bash
161+
run: |
162+
VERSION="${GITHUB_REF_NAME#v}"
163+
bash ./build-scripts/package-arch-aur.sh "${VERSION}" ./target/aur-inputs
164+
tar -C ./target/aur -czf ./target/playit-bin-PKGBUILD.tar.gz playit-bin
165+
166+
- name: Upload AUR package files
167+
uses: actions/upload-release-asset@v1
168+
env:
169+
GITHUB_TOKEN: ${{ github.token }}
170+
with:
171+
upload_url: ${{ steps.get_release.outputs.upload_url }}
172+
asset_path: ./target/playit-bin-PKGBUILD.tar.gz
173+
asset_name: playit-bin-PKGBUILD.tar.gz
174+
asset_content_type: application/gzip
175+
97176
build_windows:
98177
strategy:
99178
fail-fast: false

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ echo "deb [signed-by=/etc/apt/trusted.gpg.d/playit.gpg] https://playit-cloud.git
4545
sudo apt update
4646
```
4747

48+
### Installing on Fedora
49+
50+
Download the RPM for your architecture from the latest GitHub release, then install it with `dnf`:
51+
52+
```sh
53+
sudo dnf install ./playit_x86_64.rpm
54+
```
55+
56+
Available RPM architectures are `x86_64`, `aarch64`, `armv7hl`, and `i686`.
57+
58+
### Installing on Arch Linux
59+
60+
Install the binary AUR package:
61+
62+
```sh
63+
yay -S playit-bin
64+
```
65+
66+
The generated `playit-bin` AUR package files are also attached to GitHub releases as `playit-bin-PKGBUILD.tar.gz` for maintainers and manual publishing.
67+
4868
**Note**
4969
Please only use the playit program if you downloaded it from an offical source or are compiling and running from source.
5070

build-scripts/download.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ FILES=(
4040
playit_arm64.deb
4141
playit_armhf.deb
4242
playit_i386.deb
43+
44+
playit_x86_64.rpm
45+
playit_aarch64.rpm
46+
playit_armv7hl.rpm
47+
playit_i686.rpm
48+
49+
playit-bin-PKGBUILD.tar.gz
4350
)
4451

4552
BASE_URL="https://github.com/playit-cloud/playit-agent/releases/download/v${VERSION}"

0 commit comments

Comments
 (0)