Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhldr committed Nov 27, 2024
1 parent 276c489 commit 69ca0d6
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 5 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/archlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build Arch Linux Package

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


permissions:
contents: write # 确保具有写权限


env:
TAG_NAME: "auto"
SOFTWARE_NAME: "lfy"


jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y arch-install-scripts
- name: Create Arch root environment
run: |
mkdir arch_root
sudo pacstrap -c -d arch_root base base-devel --noconfirm
echo 'Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch' | sudo tee -a arch_root/etc/pacman.d/mirrorlist
- name: Prepare build environment
run: |
sudo mount --bind . arch_root/root/project
sudo chroot arch_root /bin/bash -c "cd /root/project && make test-aur && make BUILD_TYPE=gtk test-aur"
- name: Install any other required packages
run: |
# 根据需要替换这里的命令
pacman -S --noconfirm meson libadwaita python-gobject python-requests make python-pyqt6 appstream-glib zip
- name: Create a non-root user
run: |
useradd -m builder
echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
chown -R builder:builder /home/builder
- name: Switch to the non-root user
run: su -c "cd $GITHUB_WORKSPACE && make test-aur && make BUILD_TYPE=gtk test-aur" builder

- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
prerelease: true
draft: false
files: |
dist/*
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: AutoPkg

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]


permissions:
Expand Down

0 comments on commit 69ca0d6

Please sign in to comment.