-
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]> add dependency on prev. job Signed-off-by: Omansh Krishn <[email protected]> new logic for new release Signed-off-by: Omansh Krishn <[email protected]> repo-add is in pacman 🤦 Signed-off-by: Omansh Krishn <[email protected]> add working dir to safe dir Signed-off-by: Omansh Krishn <[email protected]>
- Loading branch information
1 parent
17ac9c4
commit 9e44f98
Showing
3 changed files
with
52 additions
and
19 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
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
name: Build Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
repository_dispatch: | ||
types: [new-release, rebuild] | ||
|
||
env: | ||
PAT: ${{secrets.PAT}} | ||
|
@@ -20,26 +19,60 @@ jobs: | |
pacman-key --init | ||
pacman-key --populate archlinux | ||
pacman -Syu --noconfirm --quiet | ||
pacman -S base-devel git sudo github-cli --noconfirm --quiet | ||
pacman -S base-devel git sudo github-cli pacman-contrib jq --noconfirm --quiet | ||
- name: Build package | ||
- name: Add a Build user | ||
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 && rm *debug*" | ||
- name: Build PKG | ||
run: | | ||
su builder -c "git clone https://github.com/materialgram/materialgram-bin /home/builder/build && cd /home/builder/build \ | ||
&& sed -i "s/pkgver=.*/pkgver=${{ github.event.client_payload.tagname }}/" PKGBUILD \ | ||
&& sed -i "s/pkgrel=.*/pkgrel=${{ github.event.client_payload.pkgrel }}/" PKGBUILD \ | ||
&& updpkgsums && makepkg --syncdeps --noconfirm --needed && rm *debug*" | ||
- name: Set filename as variable | ||
run: echo "FILENAME=$(basename /home/builder/build/*.zst)" >> $GITHUB_ENV | ||
- name: Set env variables | ||
run: | | ||
echo "FILENAME=$(basename /home/builder/build/*.zst)" >> $GITHUB_ENV | ||
export TAG=$(curl -s https://api.github.com/repos/materialgram/materialgram-bin/releases/latest | jq -r '.tag_name') | ||
echo "CURRENTTAG=$(echo $TAG)" >> $GITHUB_ENV | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.FILENAME }} | ||
path: /home/builder/build/*.zst | ||
- name: UPLOAD TO GITHUB RELEASES | ||
|
||
- name: Upload artifact to Release via gh-cli | ||
run: | | ||
echo $PAT | gh auth login --with-token | ||
export VERSION=$(cat /home/builder/build/PKGBUILD | grep 'pkgver=' | cut -d'=' -f2) | ||
gh release create ${VERSION} /home/builder/build/${{ env.FILENAME }} --repo materialgram/materialgram-bin --notes ${VERSION} | ||
if [ "${{ env.CURRENTTAG }}" == "${{ github.event.client_payload.tagname }}-${{ github.event.client_payload.pkgrel }}" ]; then gh release delete ${{ env.CURRENTTAG }} --repo materialgram/materialgram-bin -y; fi | ||
gh release create ${{ github.event.client_payload.tagname }}-${{ github.event.client_payload.pkgrel }} /home/builder/build/${{ env.FILENAME }} --repo materialgram/materialgram-bin --title ${{ github.event.client_payload.tagname }} --notes ${{ github.event.client_payload.tagname }} | ||
update-pkg-repo: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: archlinux:latest | ||
|
||
needs: build | ||
steps: | ||
- name: deps | ||
run: pacman -Sy && pacman -S git jq wget --noconfirm | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: materialgram/arch | ||
token: ${{ secrets.PAT }} | ||
|
||
- name: do the things | ||
run: | | ||
rm m* | ||
TAG=$(curl -s https://api.github.com/repos/materialgram/materialgram-bin/releases/latest | jq -r '.tag_name') | ||
BIN=$(curl -s https://api.github.com/repos/materialgram/materialgram-bin/releases/latest | jq -r '.assets[] | .name' | grep zst) | ||
URL=https://github.com/materialgram/materialgram-bin/releases/download/${TAG}/${BIN} | ||
wget $URL | ||
repo-add materialgram.db.tar.gz *zst | ||
git config --global --add safe.directory /__w/materialgram-bin/materialgram-bin && git config --global user.email "[email protected]" && git config --global user.name "Omansh Krishn" && git add . && git commit -s -m "materialgram: Update ${{ github.event.client_payload.tagname }}-${{ github.event.client_payload.pkgrel }}" | ||
git push |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Maintainer: omansh-krishn <[email protected]> | ||
# Contributor: westpain <[email protected]> | ||
pkgname=materialgram-bin | ||
pkgver=v4.15.6.1 | ||
pkgver=v4.16.4.1 | ||
pkgrel=1 | ||
pkgdesc="What if Telegram and Google had kids - Static binaries" | ||
pkgdesc="What if Telegram and Google had kids - Binary Version" | ||
arch=(x86_64) | ||
url="https://github.com/kukuruzka165/materialgram" | ||
license=(GPL3) | ||
|
@@ -16,7 +16,7 @@ conflicts=('materialgram') | |
|
||
source=( https://github.com/kukuruzka165/materialgram/releases/download/${pkgver}/materialgram-${pkgver}.tar.gz ) | ||
|
||
sha256sums=('b1f75c56184a5fb74058552b0ea24af8c4d038ddb50c42e63ac403b4f6661ead') | ||
sha256sums=('1286e78575d13cdb65dbf85ccc40aec25666320372fe92799e6f323cc2afbf05') | ||
|
||
package() { | ||
|
||
|