chore(CI): add step to publish release to AUR

This commit is contained in:
William Edwards
2025-07-15 20:36:23 -07:00
parent a74221c467
commit da01de3296
4 changed files with 126 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
# Build and publish a release of OpenGamepadUI using semantic-release whenever
# changes are merged into main.
name: "Release"
name: "🎉 Release"
on:
push:
@@ -18,6 +18,7 @@ env:
# Jobs to run
jobs:
release:
name: 🎉 Publish to GitHub
runs-on: ubuntu-latest
steps:
@@ -46,6 +47,46 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make release
# In ".releaserc.yaml" a step is defined to write the release version to
# ".version.txt" upon successful release. This step checks to see if that
# exists to determine if the other jobs need to run.
- id: status
name: Set release status
shell: bash
run: |
if [ -f .version.txt ]; then
echo "was_released=yes" >> "$GITHUB_OUTPUT"
else
echo "was_released=no" >> "$GITHUB_OUTPUT"
fi
# Upload the package build for the AUR publish step
- name: Upload PKGBUILD
uses: actions/upload-artifact@v4
if: steps.status.outputs.was_released == 'yes'
with:
name: PKGBUILD
path: ./package/archlinux/PKGBUILD
if-no-files-found: error
- name: Upload Release Version
uses: actions/upload-artifact@v4
if: steps.status.outputs.was_released == 'yes'
with:
name: version.txt
path: .version.txt
if-no-files-found: error
include-hidden-files: true
outputs:
should_publish: ${{ steps.status.outputs.was_released }}
publish-docs:
name: 📔 Publish documentation
needs: release
if: needs.release.outputs.should_publish == 'yes'
runs-on: ubuntu-latest
steps:
- name: Trigger documentation generation
run: |
curl -L -X POST \
@@ -54,3 +95,46 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ShadowBlip/OpenGamepadUI/dispatches \
--data '{"event_type": "Trigger Workflow", "client_payload": { "repository": "'"$GITHUB_REPOSITORY"'" }}'
publish-to-aur:
name: 🐧 Publish to AUR
needs: release
if: needs.release.outputs.should_publish == 'yes'
runs-on: ubuntu-latest
steps:
- name: Download PKGBUILD
uses: actions/download-artifact@v4
with:
name: PKGBUILD
- name: Download Release Version
uses: actions/download-artifact@v4
with:
name: version.txt
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v3
with:
host: aur.archlinux.org
private-key: ${{ secrets.AUR_SSH_KEY }}
- name: Checkout AUR bin
run: git clone ssh://aur@aur.archlinux.org/opengamepadui-bin.git
- name: Copy PKGBUILD to bin repo
run: cp ./PKGBUILD opengamepadui-bin/
- name: Build bin package
working-directory: opengamepadui-bin
run: make in-docker
- name: Commit and publish bin package
shell: bash
working-directory: opengamepadui-bin
run: |
git config user.name "github-actions[bot]"
git config user.email "shadowblip+github-actions[bot]@users.noreply.github.com"
git add .SRCINFO PKGBUILD
git commit -m "Update to $(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)"
git push origin master

View File

@@ -23,27 +23,27 @@ plugins:
- core/global/version.tres
from: "core = .*"
to: 'core = "${nextRelease.version}"'
#results:
# - file: core/global/version.tres
# hasChanged: true
# numMatches: 1
# numReplacements: 1
#countMatches: true
- files:
- package/rpm/opengamepadui.spec
from: "Version: .*"
to: "Version: ${nextRelease.version}"
- files:
- package/archlinux/PKGBUILD
from: "^pkgver=v.*$"
to: "pkgver=v${nextRelease.version}"
# Execute commands to build the project
- - "@semantic-release/exec"
- shell: true
prepareCmd: "make in-docker IMAGE_TAG=4.4.1 TARGET='force-import dist update-pkgbuild-hash'"
publishCmd: "echo '${nextRelease.version}' > .version.txt"
# Commit the following changes to git after other plugins have run
- - "@semantic-release/git"
- assets:
- core/global/version.tres
- package/rpm/opengamepadui.spec
# Execute commands to build the project
- - "@semantic-release/exec"
- shell: true
prepareCmd: "make in-docker IMAGE_TAG=4.4.1 TARGET='force-import dist'"
- package/archlinux/PKGBUILD
# Publish artifacts as a GitHub release
- - "@semantic-release/github"

View File

@@ -448,6 +448,10 @@ $(CACHE_DIR)/libserialport:
mkdir -p $(CACHE_DIR)/libserialport
tar xvf $(CACHE_DIR)/libserialport.tar -C $(CACHE_DIR)/libserialport
.PHONY: update-pkgbuild-hash
update-pkgbuild-hash: dist/opengamepadui.tar.gz ## Update the PKGBUILD hash
sed -i "s#^sha256sums=.*#sha256sums=('$$(cat dist/opengamepadui.tar.gz.sha256.txt | cut -d' ' -f1)')#g" \
package/archlinux/PKGBUILD
# Refer to .releaserc.yaml for release configuration
.PHONY: release

View File

@@ -0,0 +1,26 @@
# Maintainer: Derek J. Clark <derekjohn.clark@gmail.com>
pkgname=opengamepadui-bin
_pkgbase=opengamepadui
pkgver=0.40.4
pkgrel=1
pkgdesc="Open source game launcher"
arch=('x86_64')
url="https://github.com/ShadowBlip/OpenGamepadUI"
license=('GPL')
depends=('glibc' 'gcc-libs' 'libx11' 'libxres' 'libxcb' 'libxext' 'libxau'
'libxdmcp' 'gamescope' 'vulkan-tools' 'inputplumber'
'mesa-utils'
)
optdepends=('firejail' 'bubblewrap' 'wireplumber' 'networkmanager' 'bluez' 'dbus' 'powerstation')
provides=('opengamepadui')
conflicts=('opengamepadui-git')
source=(opengamepadui-v$pkgver.tar.gz::https://github.com/ShadowBlip/OpenGamepadUI/releases/download/v$pkgver/opengamepadui.tar.gz)
sha256sums=('18de3a83d65b79e334a02f2d08d96dedc470ddc5f8c312833b03ea5346832d2b')
package() {
options=('!strip')
cd "$srcdir/${_pkgbase}"
make install PREFIX="${pkgdir}/usr"
}