-
Notifications
You must be signed in to change notification settings - Fork 8
122 lines (120 loc) · 4.01 KB
/
Copy pathxivlauncher.yml
File metadata and controls
122 lines (120 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: xivlauncher
on:
push:
paths:
- PKGBUILD
- PKGBUILD-git
- .github/workflows/xivlauncher.yml
pull_request:
branches:
- main
paths:
- PKGBUILD
- PKGBUILD-git
workflow_dispatch:
inputs:
aur:
description: 'Push to AUR?'
required: false
default: 'false'
type: boolean
jobs:
build:
strategy:
matrix:
variant:
- xivlauncher
- xivlauncher-git
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Prepare container
run: |
echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
pacman-key --init
pacman -Sy --noconfirm --needed archlinux-keyring
pacman -Syu --noconfirm base-devel git rsync openssh
useradd -m -s /bin/bash builder
echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder
- uses: actions/checkout@v6
- name: Use git PKGBUILD
if: matrix.variant == 'xivlauncher-git'
run:
mv PKGBUILD{-git,}
- name: Prepare workspace
run: |
mkdir /home/builder/workspace
rsync -ahvP /__w/aur-xivlauncher/aur-xivlauncher/ /home/builder/workspace/
chown -R builder:builder /home/builder/
- name: Build package
working-directory: /home/builder/workspace
run: |
sudo -u builder makepkg -scf --noconfirm
sudo -u builder makepkg --printsrcinfo | tee .SRCINFO
- name: Rename artifact
working-directory: /home/builder/workspace
run: mv *.pkg.tar.zst ${{ matrix.variant }}.pkg.tar.zst
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.variant }}
path: |
/home/builder/workspace/*.pkg.tar.zst
/home/builder/workspace/.SRCINFO
if-no-files-found: error
include-hidden-files: true
aur:
needs: build
strategy:
matrix:
variant:
- xivlauncher
- xivlauncher-git
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event.inputs.aur == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
path: 'github'
- name: Use git PKGBUILD
if: matrix.variant == 'xivlauncher-git'
working-directory: "${{ github.workspace }}/github"
run:
mv PKGBUILD{-git,}
- name: Prepare SSH
run: |
mkdir -p "$HOME"/.ssh
chmod 700 "$HOME"/.ssh
ssh-keyscan aur.archlinux.org >> "$HOME"/.ssh/known_hosts
echo "${{ secrets.ssh_key }}" > "$HOME"/.ssh/id_ed25519
chmod 400 "$HOME"/.ssh/*
ssh-keygen -y -f "$HOME"/.ssh/id_ed25519 > "$HOME"/.ssh/id_ed25519.pub
- name: Checkout AUR
run: |
git clone ssh://aur@aur.archlinux.org/${{ matrix.variant }}.git "$GITHUB_WORKSPACE"/aur
- name: Download (.SRCINFO) artifact
uses: actions/download-artifact@v8
with:
name: ${{ matrix.variant }}
- name: Copy files
run: |
rsync -ahvP "$GITHUB_WORKSPACE"/github/{PKGBUILD,XIVLauncher.desktop,xivlauncher-core} "$GITHUB_WORKSPACE"/aur/
rsync -ahvP "$GITHUB_WORKSPACE"/.SRCINFO "$GITHUB_WORKSPACE"/aur/.SRCINFO
- name: Check git status
id: gitstatus
working-directory: "${{ github.workspace }}/aur"
run: |
test -z "$(git status --porcelain)" && echo "clean=1" >> "$GITHUB_OUTPUT" || echo "clean=0" >> "$GITHUB_OUTPUT"
- name: Push
if: success() && steps.gitstatus.outputs.clean == '0'
working-directory: "${{ github.workspace }}/aur"
run: |
git config user.email "cent@spline.de"
git config user.name "cent"
git add --all
git commit -m 'sync from github'
git push -u origin master
- name: Cleanup SSH
if: always()
run: rm -rf "$HOME"/.ssh