-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (41 loc) · 1.71 KB
/
build.yml
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
name: Build Package
on:
push:
branches:
- main
env:
PAT: ${{secrets.PAT}}
jobs:
build:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Update system and install dependencies
run: |
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --noconfirm --quiet
pacman -S base-devel git sudo github-cli --noconfirm --quiet
- name: Build package
run: |
useradd -m builder
echo "builder ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers
su builder -c "git clone https://github.com/materialgram/materialgram-bin /home/builder/build && cd /home/builder/build && makepkg --syncdeps --noconfirm --needed"
- name: Set filename as variable
run: echo "FILENAME=$(basename /home/builder/build/*.zst)" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME }}
path: /home/builder/build/*.zst
- name: UPLOAD TO GITHUB RELEASES
run: |
echo $PAT | gh auth login --with-token
export VERSION=$(cat /home/builder/build/PKGBUILD | grep 'pkgver=' | cut -d'=' -f2)
git config --global user.email "[email protected]"
git config --global user.name "Omansh Krishn"
git config --global --add safe.directory /home/builder/build
git -C '/home/builder/build' tag -a ${VERSION}
git -C '/home/builder/build' push "https://omansh-krishn:${PAT}@github.com/materialgram/materialgram-bin.git" ${VERSION}
gh release create ${VERSION} /home/builder/build/${{ env.FILENAME }} --repo materialgram/materialgram-bin