diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 794de2e..9f29dc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c2c1af..aa7d475 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -32,6 +56,7 @@ jobs: build-deb: name: Build .deb (${{ matrix.arch }}) + needs: prep runs-on: ubuntu-latest strategy: matrix: @@ -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 @@ -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 }} \ @@ -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/ @@ -80,6 +103,7 @@ jobs: build-rpm: name: Build .rpm (${{ matrix.arch }}) + needs: prep runs-on: ubuntu-latest strategy: matrix: @@ -98,10 +122,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 .rpm package run: | docker run --rm --platform ${{ matrix.docker_platform }} \ @@ -109,10 +129,11 @@ jobs: 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/ @@ -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 @@ -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 @@ -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 }} diff --git a/README.md b/README.md index 54cc2e8..c39275e 100644 --- a/README.md +++ b/README.md @@ -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