Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
docker_platform: linux/arm64
- arch: armhf
docker_platform: linux/arm/v7
- arch: armel
docker_platform: linux/arm/v6

steps:
- name: Checkout
Expand Down
55 changes: 40 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ permissions:
id-token: write

jobs:
prep:
name: Resolve Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.v.outputs.version }}
pkg_version: ${{ steps.v.outputs.pkg_version }}
is_prerelease: ${{ steps.v.outputs.is_prerelease }}
steps:
- name: Parse tag
id: v
run: |
TAG="${GITHUB_REF_NAME#v}"
# RPM/DEB disallow '-' in upstream version; '~' sorts before release
PKG_VERSION="${TAG//-/\.}"
if [[ "$TAG" == *-* ]]; then
IS_PRERELEASE=true
else
IS_PRERELEASE=false
fi
echo "version=$TAG" >> "$GITHUB_OUTPUT"
echo "pkg_version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
echo "is_prerelease=$IS_PRERELEASE" >> "$GITHUB_OUTPUT"
echo "Tag=$TAG pkg=$PKG_VERSION prerelease=$IS_PRERELEASE"

build-flipper:
name: Build Flipper App
runs-on: ubuntu-latest
Expand All @@ -32,6 +56,7 @@ jobs:

build-deb:
name: Build .deb (${{ matrix.arch }})
needs: prep
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -42,6 +67,8 @@ jobs:
docker_platform: linux/arm64
- arch: armhf
docker_platform: linux/arm/v7
- arch: armel
docker_platform: linux/arm/v6

steps:
- name: Checkout
Expand All @@ -52,10 +79,6 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Build .deb package
run: |
docker run --rm --platform ${{ matrix.docker_platform }} \
Expand All @@ -65,8 +88,8 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends \
build-essential debhelper
# Update changelog version from tag
sed -i "1s/([^)]*)/('"${{ steps.version.outputs.version }}"'-1)/" debian/changelog
# Update changelog version from tag ("~" sorts before release per Debian policy)
sed -i "1s/([^)]*)/('"${{ needs.prep.outputs.pkg_version }}"'-1)/" debian/changelog
dpkg-buildpackage -us -uc -b
mkdir -p output
mv ../*.deb output/
Expand All @@ -80,6 +103,7 @@ jobs:

build-rpm:
name: Build .rpm (${{ matrix.arch }})
needs: prep
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -98,21 +122,18 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Build .rpm package
run: |
docker run --rm --platform ${{ matrix.docker_platform }} \
-v "$PWD":/build -w /build \
rockylinux:9 bash -c '
set -e
dnf install -y gcc make kernel-headers rpm-build systemd-rpm-macros
VERSION='"${{ steps.version.outputs.version }}"'
# RPM disallows "-" in Version; tag "v0.0.1-beta" → "0.0.1~beta" (sorts before 0.0.1)
VERSION='"${{ needs.prep.outputs.pkg_version }}"'
# Create source tarball
mkdir -p /root/rpmbuild/{SOURCES,SPECS}
tar czf /root/rpmbuild/SOURCES/infrafid-${VERSION}.tar.gz \
tar czf "/root/rpmbuild/SOURCES/infrafid-${VERSION}.tar.gz" \
--transform "s,^\.,infrafid-${VERSION}," \
--exclude=.git .
cp rpm/infrafid.spec /root/rpmbuild/SPECS/
Expand All @@ -128,7 +149,7 @@ jobs:
path: output/*.rpm

release:
needs: [build-flipper, build-deb, build-rpm]
needs: [prep, build-flipper, build-deb, build-rpm]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand All @@ -145,9 +166,13 @@ jobs:
packages/*.rpm
packages/*.fap
generate_release_notes: true
prerelease: ${{ needs.prep.outputs.is_prerelease == 'true' }}

publish-repos:
needs: [build-deb, build-rpm]
needs: [prep, build-deb, build-rpm]
# Prereleases (e.g. v0.0.1-beta) skip the stable apt/yum repos to avoid
# pushing preview builds to users running `apt install infrafid`.
if: needs.prep.outputs.is_prerelease != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -212,7 +237,7 @@ jobs:
Origin: infrafid
Label: infrafid
Codename: stable
Architectures: amd64 arm64 armhf
Architectures: amd64 arm64 armhf armel
Components: main
Description: InfraFi IR WiFi credential receiver daemon
SignWith: ${{ env.GPG_KEY_ID }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The install script automatically:

### Pre-built Packages

Debian/Ubuntu and RPM packages are available from [GitHub Releases](https://github.com/amd989/infrafi/releases) for amd64, arm64, and armhf architectures.
Debian/Ubuntu and RPM packages are available from [GitHub Releases](https://github.com/amd989/infrafi/releases) for amd64, arm64, armhf, and armel (ARMv6, Raspberry Pi Zero/1) architectures.

**APT repository:**
```bash
Expand Down
Loading