build: copy the correct folder #102
Workflow file for this run
This file contains hidden or 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
| 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"/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 status | |
| find . | |
| - name: Cleanup SSH | |
| if: always() | |
| run: rm -rf "$HOME"/.ssh |