-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Omansh Krishn <[email protected]>
- Loading branch information
1 parent
f7b8fe6
commit e5d863f
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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/omansh-krishn/build-materialgram.git /home/builder/build && cd /home/builder/build && makepkg --syncdeps --noconfirm --needed" | ||
- name: Set filename as variable | ||
id: set-filename | ||
run: echo "::set-output name=filename::$(basename /home/builder/build/*.zst)" | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.set-filename.outputs.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) | ||
export FILE_NAME=${{ steps.set-filename.outputs.filename }} | ||
gh release create ${VERSION}-materialgram /home/builder/build/${FILE_NAME} --repo materialgram/materialgram-bin | ||