Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
fix: add building action
Browse files Browse the repository at this point in the history
  • Loading branch information
boredland committed Mar 7, 2021
1 parent 57284f6 commit be2e199
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/additional_gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16792B4EA25340F8
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
5 changes: 5 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# inherits settings from https://github.com/Manjaro-Sway/.github/blob/main/.github/settings.yml
_extends: .github
repository:
homepage: ssh://[email protected]:22277/packages/community/gtk3-nocsd.git
# you can extend settings using https://probot.github.io/apps/settings/
18 changes: 18 additions & 0 deletions .github/workflows/bootstrap.yml_
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: bootstrap
on:
workflow_dispatch:
schedule:
- cron: '0 1-23/2 * * *'

jobs:
botstrap_actions:
runs-on: ubuntu-latest
steps:
-
name: checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.BOOTSTRAP_WORKFLOWS }}
-
id: bootstrap
uses: Manjaro-Sway/bootstrap-package-actions@master
34 changes: 34 additions & 0 deletions .github/workflows/increment-rel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: increment pkgrel

on:
workflow_dispatch:
inputs:
pkgrel:
description: 'pkgrel to set - will iterate if not given'
required: false

jobs:
increment:
runs-on: ubuntu-latest
steps:
-
name: checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.PUSH_AND_TRIGGER }}
-
name: increment_rel
run: |
CURRENT_VERSION=$(cat PKGBUILD | grep pkgrel | sed -e 's/^pkgrel=//')
INPUT_VERSION=${{ github.event.inputs.pkgrel }}
NEXT_VERSION=$((CURRENT_VERSION + 1))
sed -i "/pkgrel=/c\pkgrel=${INPUT_VERSION:-${NEXT_VERSION}}" PKGBUILD
git config user.name increment-version-action
git config user.email [email protected]
-
name: commit
run: |
git add PKGBUILD
git commit -m "release: increment rel"
git push
116 changes: 116 additions & 0 deletions .github/workflows/pkgbuild_next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: pkgbuild_next

on:
workflow_dispatch:
push:
branches:
- master
- main

jobs:
prepare:
runs-on: ubuntu-20.04
name: prepare
steps:
-
uses: actions/checkout@v2
-
name: check-updatable
id: check
run: |
VERSION=$(cat PKGBUILD | grep pkgver= | sed -e 's/^pkgver=//')-$(cat PKGBUILD | grep pkgrel= | sed -e 's/^pkgrel=//')
echo "ARCHITECTURES=$(cat PKGBUILD | grep arch= | sed -e 's/^arch=(\(.*\))/\1/')" >>$GITHUB_ENV
echo "VERSION=${VERSION}" >>$GITHUB_ENV
git fetch --tags
git rev-list "${VERSION}" >/dev/null && \
echo "::set-output name=updatable::false" || \
echo "::set-output name=updatable::true"
-
run: echo ${{ steps.check.outputs.updatable }}
-
name: create_release
id: release
uses: actions/create-release@v1
if: ${{ steps.check.outputs.updatable == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false
outputs:
updatable: ${{ steps.check.outputs.updatable }}
architectures: ${{ env.ARCHITECTURES }}
version: ${{ env.VERSION }}
upload_url: ${{ steps.release.outputs.upload_url }}
pkgbuild:
runs-on: ubuntu-20.04
name: ${{ matrix.distro }} ${{ matrix.arch }}
needs: [prepare]
if: ${{ needs.prepare.outputs.updatable == 'true' }}
strategy:
matrix:
include:
- arch: aarch64
distro: manjaro_latest
archlinux_arch: aarch64
- arch: amd64
distro: manjaro_latest
archlinux_arch: x86_64
steps:
-
uses: actions/checkout@v2
-
name: get-additional-gpg
run: |
echo "ADDITIONAL_GPG=$(cat .github/additional_gpg)" >>$GITHUB_ENV
-
uses: Manjaro-Sway/run-on-arch-action@master
if: contains(needs.prepare.outputs.architectures, matrix.archlinux_arch)
name: build
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/artifacts"
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
--cap-add=SYS_ADMIN
shell: /bin/sh
install: |
if [ -n "${{ env.ADDITIONAL_GPG }}" ]; then
for key in "${{ env.ADDITIONAL_GPG }}"; do
sudo -u builder gpg --recv-key $key
done
fi
run: |
chown builder $PWD
sudo -u builder makepkg -fsAc --noconfirm --noprogressbar
cp *.pkg.tar.zst /artifacts/
-
name: determine-filename
if: contains(needs.prepare.outputs.architectures, matrix.archlinux_arch)
run: echo "FILE_NAME=$(basename $(find ./artifacts/ -type f \( -name "*.pkg.tar.zst" \)))" >> $GITHUB_ENV
-
name: release
if: contains(needs.prepare.outputs.architectures, matrix.archlinux_arch)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare.outputs.upload_url }}
asset_path: "./artifacts/${{ env.FILE_NAME }}"
asset_name: ${{ env.FILE_NAME }}
asset_content_type: application/zstd
-
name: dispatch
if: contains(needs.prepare.outputs.architectures, matrix.archlinux_arch)
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.DISPATCH }}
repository: manjaro-sway/packages
event-type: package_update
client-payload: '{ "repository": "${{ github.repository }}", "version": "${{ needs.prepare.outputs.version }}", "file_name": "${{ env.FILE_NAME }}"}'
36 changes: 36 additions & 0 deletions .github/workflows/resubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: resubmit the release

on:
workflow_dispatch:
schedule:
- cron: '20 1-23/2 * * *'

jobs:
resubmit:
runs-on: ubuntu-latest
steps:
-
name: set version
run: |
LATEST_INFO=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest")
echo "FILE_NAME_AARCH64=$(echo $LATEST_INFO | jq -r '.assets[].name' | grep aarch64)" >> $GITHUB_ENV
echo "FILE_NAME_X86_64=$(echo $LATEST_INFO | jq -r '.assets[].name' | grep -E -i -w '(x86_64|any)')" >> $GITHUB_ENV
echo "VERSION=$(echo $LATEST_INFO | jq -r '.tag_name')" >> $GITHUB_ENV
-
name: dispatch_aarch64
if: env.FILE_NAME_AARCH64 != ''
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.DISPATCH }}
repository: manjaro-sway/packages
event-type: package_update
client-payload: '{ "repository": "${{ github.repository }}", "version": "${{ env.VERSION }}", "file_name": "${{ env.FILE_NAME_AARCH64 }}"}'
-
name: dispatch_x86_64
if: env.FILE_NAME_X86_64 != ''
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.DISPATCH }}
repository: manjaro-sway/packages
event-type: package_update
client-payload: '{ "repository": "${{ github.repository }}", "version": "${{ env.VERSION }}", "file_name": "${{ env.FILE_NAME_X86_64 }}"}'
32 changes: 32 additions & 0 deletions .github/workflows/set-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: set version to src version

on:
repository_dispatch:
types: [source_update]

jobs:
update-version:
runs-on: ubuntu-latest
steps:
-
name: check out the repo
id: checkout_repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PUSH_AND_TRIGGER }}
-
name: update pkgbuild
env:
VERSION: ${{ github.event.client_payload.version }}
MD5: ${{ github.event.client_payload.md5 }}
run: |
sed -i "/pkgver=/c\pkgver=${VERSION}" PKGBUILD
sed -i "/_sourcemd5=/c\_sourcemd5=${MD5}" PKGBUILD
-
name: commit
run: |
git config --global user.name "Repo Update Bot"
git config --global user.email "[email protected]"
git add PKGBUILD
git commit -m "chore: release version ${{ github.event.client_payload.version }}"
git push
1 change: 1 addition & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Maintainer: Bartłomiej Piotrowski <[email protected]>
# Contributor: Allan McRae <[email protected]>
# Contributor: Jonas Strassel <[email protected]>

# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: valgrind requires rebuilt with each major glibc version
Expand Down

0 comments on commit be2e199

Please sign in to comment.