-
Notifications
You must be signed in to change notification settings - Fork 8
97 lines (95 loc) · 3.08 KB
/
Copy pathxivlauncher.yml
File metadata and controls
97 lines (95 loc) · 3.08 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
name: xivlauncher
on:
push:
paths:
- PKGBUILD
- .github/workflows/xivlauncher.yml
pull_request:
branches:
- main
paths:
- PKGBUILD
workflow_dispatch:
inputs:
aur:
description: 'Push to AUR?'
required: false
default: 'false'
type: boolean
jobs:
build:
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: 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
run: |
cd /home/builder/workspace
sudo -u builder makepkg -scf --noconfirm
sudo -u builder makepkg --printsrcinfo | tee .SRCINFO
- name: Rename artifact
run: |
cd /home/builder/workspace
mv *.pkg.tar.zst xivlauncher.pkg.tar.zst
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: xivlauncher
path: |
/home/builder/workspace/*.pkg.tar.zst
/home/builder/workspace/.SRCINFO
if-no-files-found: error
include-hidden-files: true
aur:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
path: 'github'
- 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/xivlauncher.git "$GITHUB_WORKSPACE"/aur
- name: Download (.SRCINFO) artifact
uses: actions/download-artifact@v8
with:
name: xivlauncher
- name: Copy files
run: |
rsync -ahvP "$GITHUB_WORKSPACE"/aur/{PKGBUILD,XIVLauncher.desktop,xivlauncher-core} "$GITHUB_WORKSPACE"/aur/
rsync -ahvP "$GITHUB_WORKSPACE"/.SRCINFO "$GITHUB_WORKSPACE"/aur/.SRCINFO
- name: Check git status
id: gitstatus
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'
run: |
cd "$GITHUB_WORKSPACE/aur"
git status
find .
- name: Cleanup SSH
if: always()
run: rm -rf "$HOME"/.ssh