-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,64 @@ jobs: | |
name: debian-latest | ||
path: release | ||
|
||
build-f40: | ||
name: Build Fedora 40 package | ||
runs-on: ubuntu-latest | ||
container: | ||
image: registry.fedoraproject.org/fedora:40 | ||
options: --security-opt seccomp=unconfined | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install build dependencies | ||
run: | | ||
dnf distro-sync -y | ||
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)' | ||
dnf builddep -y pkg/fedora/libwacom-surface.spec | ||
- name: Build package | ||
run: | | ||
cd pkg/fedora | ||
# Build the .rpm packages | ||
./makerpm | ||
- name: Sign packages | ||
env: | ||
GPG_KEY_ID: 56C464BAAC421453 | ||
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }} | ||
run: | | ||
cd pkg/fedora/out | ||
# import GPG key | ||
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes | ||
# sign package | ||
cd noarch | ||
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID" | ||
cd .. | ||
cd x86_64 | ||
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID" | ||
- name: Prepare artifacts | ||
run: | | ||
cd pkg/fedora | ||
mkdir release | ||
cp out/noarch/* release/ | ||
cp out/x86_64/* release/ | ||
rm release/libwacom-surface-devel-* | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: fedora-40-latest | ||
path: pkg/fedora/release | ||
|
||
build-f39: | ||
name: Build Fedora 39 package | ||
runs-on: ubuntu-latest | ||
|
@@ -199,7 +257,7 @@ jobs: | |
|
||
release: | ||
name: Publish release | ||
needs: [build-deb, build-f39, build-f38] | ||
needs: [build-deb, build-f40, build-f39, build-f38] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Debian artifacts | ||
|
@@ -208,6 +266,12 @@ jobs: | |
name: debian-latest | ||
path: debian-latest | ||
|
||
- name: Download Fedora 40 artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: fedora-40-latest | ||
path: fedora-40-latest | ||
|
||
- name: Download Fedora 39 artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
@@ -281,6 +345,59 @@ jobs: | |
git commit -m "Update Debian libwacom" | ||
git push --set-upstream origin "${update_branch}" | ||
repo-f40: | ||
name: Update Fedora 40 package repository | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: registry.fedoraproject.org/fedora:40 | ||
options: --security-opt seccomp=unconfined | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
dnf install -y git findutils | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: fedora-40-latest | ||
path: fedora-40-latest | ||
|
||
- name: Update repository | ||
env: | ||
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }} | ||
BRANCH_STAGING: u/staging | ||
GIT_REF: ${{ github.ref }} | ||
run: | | ||
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git" | ||
# clone package repository | ||
git clone -b "${BRANCH_STAGING}" "${repo}" repo | ||
# copy packages | ||
cp fedora-40-latest/* repo/fedora/f40 | ||
cd repo/fedora/f40 | ||
# parse git tag from ref | ||
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g') | ||
# convert packages into references | ||
for pkg in $(find . -name '*.rpm'); do | ||
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob | ||
rm $pkg | ||
done | ||
# set git identity | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "surfacebot" | ||
# commit and push | ||
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" | ||
git checkout -b "${update_branch}" | ||
git add . | ||
git commit -m "Update Fedora 40 libwacom" | ||
git push --set-upstream origin "${update_branch}" | ||
repo-f39: | ||
name: Update Fedora 39 package repository | ||
needs: [release] | ||
|