Skip to content

Commit

Permalink
chore: fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mufanc committed Dec 10, 2023
1 parent 17f1ad2 commit 038a3fd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build CI

on:
push:
branches: [ master ]
branches: [ archlinux ]
paths-ignore:
- '**.md'
workflow_dispatch:
Expand All @@ -19,12 +19,22 @@ jobs:
with:
fetch-depth: 0

- name: Repack Linux-QQ
run: make
- name: Setup ArchLinux
uses: docker://archlinux:latest
with:
entrypoint: /bin/bash
args: .github/workflows/scripts/ci.sh

- name: Prepare Artifact
id: prepare_artifact
run: |
echo "name=$(echo qwrapper*.pkg | sed 's/.pkg.*//')" >> $GITHUB_OUTPUT
- name: Upload Artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: LinuxQQ-patched.deb
path: LinuxQQ-patched.deb
name: ${{ steps.prepare_artifact.outputs.name }}
path: |
PKGBUILD
qwrapper*.pkg.*
13 changes: 13 additions & 0 deletions .github/workflows/scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -ex

pacman -Syu --noconfirm --needed base-devel rustup pacman-contrib

rustup toolchain install stable
rustup toolchain install nightly

chmod -R a+rw .
useradd builder -m && echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

sudo -u builder BUILDARGS="--syncdeps --noconfirm" make
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
set -ex

export SOURCE=$(curl -s https://im.qq.com/rainbow/linuxQQDownload/ | grep -Eo '"deb":"[^"]+"' | grep -Eo 'https://.*_amd64\.deb')
export PKGVER=$(echo "$SOURCE" | awk -F "linuxqq_|-" '{print $2}')
export PKGROOT=$(realpath "$(dirname "$0")")

envsubst "$(env | grep -Po '^[A-Z_]+(?==)' | sed 's/^/$/g')" < PKGBUILD.proto > PKGBUILD
updpkgsums
makepkg -f

# shellcheck disable=SC2086
makepkg -f $BUILDARGS
2 changes: 2 additions & 0 deletions inject/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "stable"

0 comments on commit 038a3fd

Please sign in to comment.