Skip to content

Commit c042ee4

Browse files
committed
build: use matrix workflow
1 parent de8009a commit c042ee4

2 files changed

Lines changed: 25 additions & 92 deletions

File tree

.github/workflows/xivlauncher-git.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/xivlauncher.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ on:
44
push:
55
paths:
66
- PKGBUILD
7+
- PKGBUILD-git
78
- .github/workflows/xivlauncher.yml
89
pull_request:
910
branches:
1011
- main
1112
paths:
1213
- PKGBUILD
14+
- PKGBUILD-git
1315
workflow_dispatch:
1416
inputs:
1517
aur:
@@ -20,6 +22,11 @@ on:
2022

2123
jobs:
2224
build:
25+
strategy:
26+
matrix:
27+
variant:
28+
- xivlauncher
29+
- xivlauncher-git
2330
runs-on: ubuntu-latest
2431
container: archlinux:latest
2532
steps:
@@ -32,6 +39,10 @@ jobs:
3239
useradd -m -s /bin/bash builder
3340
echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder
3441
- uses: actions/checkout@v6
42+
- name: Use git PKGBUILD
43+
if: matrix.variant == 'xivlauncher-git'
44+
run:
45+
mv PKGBUILD{-git,}
3546
- name: Prepare workspace
3647
run: |
3748
mkdir /home/builder/workspace
@@ -45,25 +56,35 @@ jobs:
4556
- name: Rename artifact
4657
run: |
4758
cd /home/builder/workspace
48-
mv *.pkg.tar.zst xivlauncher.pkg.tar.zst
59+
mv *.pkg.tar.zst ${{ matrix.variant }}.pkg.tar.zst
4960
- name: Upload artifact
5061
uses: actions/upload-artifact@v6
5162
with:
52-
name: xivlauncher
63+
name: ${{ matrix.variant }}
5364
path: |
5465
/home/builder/workspace/*.pkg.tar.zst
5566
/home/builder/workspace/.SRCINFO
5667
if-no-files-found: error
5768
include-hidden-files: true
5869
aur:
5970
needs: build
71+
strategy:
72+
matrix:
73+
variant:
74+
- xivlauncher
75+
- xivlauncher-git
6076
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event.inputs.aur == 'true' }}
6177
runs-on: ubuntu-latest
6278
steps:
6379
- name: Checkout repo
6480
uses: actions/checkout@v6
6581
with:
6682
path: 'github'
83+
- name: Use git PKGBUILD
84+
if: matrix.variant == 'xivlauncher-git'
85+
working-directory: "${{ github.workspace }}/github"
86+
run:
87+
mv PKGBUILD{-git,}
6788
- name: Prepare SSH
6889
run: |
6990
mkdir -p "$HOME"/.ssh
@@ -74,11 +95,11 @@ jobs:
7495
ssh-keygen -y -f "$HOME"/.ssh/id_ed25519 > "$HOME"/.ssh/id_ed25519.pub
7596
- name: Checkout AUR
7697
run: |
77-
git clone ssh://aur@aur.archlinux.org/xivlauncher.git "$GITHUB_WORKSPACE"/aur
98+
git clone ssh://aur@aur.archlinux.org/${{ matrix.variant }}.git "$GITHUB_WORKSPACE"/aur
7899
- name: Download (.SRCINFO) artifact
79100
uses: actions/download-artifact@v8
80101
with:
81-
name: xivlauncher
102+
name: ${{ matrix.variant }}
82103
- name: Copy files
83104
run: |
84105
rsync -ahvP "$GITHUB_WORKSPACE"/github/{PKGBUILD,XIVLauncher.desktop,xivlauncher-core} "$GITHUB_WORKSPACE"/aur/

0 commit comments

Comments
 (0)