Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
chore(actions-bootstrap): update default actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstrap-package-actions committed Jan 13, 2022
1 parent 2dc0845 commit 84bc817
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 0 deletions.
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: https://aur.archlinux.org/rofi-bluetooth-git.git
# you can extend settings using https://probot.github.io/apps/settings/
23 changes: 23 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "forward-all-contributors"
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]

jobs:
add-contributors:
runs-on: ubuntu-latest
steps:
- name: check user has write access
uses: lannonbr/[email protected]
with:
permission: "write"
- name: create comment in target repo
uses: peter-evans/create-or-update-comment@v1
if: contains(github.event.comment.body, '@all-contributors')
with:
issue-number: 73
repository: manjaro-sway/manjaro-sway
body: ${{ github.event.comment.body }}
token: ${{ secrets.PUSH_AND_TRIGGER }}
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/[email protected]
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
50 changes: 50 additions & 0 deletions .github/workflows/pkgbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: pkgbuild

on:
workflow_dispatch:
inputs:
force-update:
description: 'update artifacts'
required: false
default: 'false'
push:
branches:
- master
- main

jobs:
pkgbuild:
runs-on: ubuntu-20.04
timeout-minutes: 15
strategy:
matrix:
archlinux_arch: [aarch64, x86_64]
include:
- archlinux_arch: aarch64
docker_arch: aarch64
- archlinux_arch: x86_64
docker_arch: amd64
name: pkgbuild for ${{ matrix.archlinux_arch }}
steps:
- uses: actions/checkout@v2
- name: pkgbuild
id: pkgbuild
uses: Manjaro-Sway/manjaro-package-action@main
with:
docker_arch: ${{ matrix.docker_arch }}
archlinux_arch: ${{ matrix.archlinux_arch }}
gpg_keyid: ${{ secrets.GPG_KEYID }}
gpg_signing_key_base64: ${{ secrets.GPG_SECRET_KEY_BASE64 }}
dispatch-token: ${{ secrets.DISPATCH }}
force-update: ${{ github.event.inputs.force-update }}
- name: telegram
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_web_page_preview: true
message: |
Failed to build ${{ github.repository }} for ${{ matrix.archlinux_arch }}
Check pipeline: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
46 changes: 46 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: rebase

on:
workflow_dispatch:
schedule:
- cron: '*/30 * * * *'

env:
UPSTREAM_GIT: https://aur.archlinux.org/rofi-bluetooth-git.git

jobs:
rebase:
runs-on: ubuntu-latest
steps:
-
name: checkout
uses: actions/[email protected]
with:
token: ${{ secrets.PUSH_AND_TRIGGER }}
fetch-depth: 0
-
name: add ssh pk
if: ${{ contains(env.UPSTREAM_GIT, 'ssh') }}
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_BASE64 }}" | base64 -d >~/.ssh/id_rsa && chmod 400 ~/.ssh/id_rsa
[ -f .github/additional_known_hosts ] && cat .github/additional_known_hosts >> ~/.ssh/known_hosts
-
name: check if behind upstream
run: |
git remote add upstream ${UPSTREAM_GIT}
git fetch upstream
git config --global user.email "[email protected]"
git config --global user.name "Manjaro Sway"
git rebase upstream/$(git branch --show-current) && git push --force-with-lease
- name: telegram
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_web_page_preview: true
message: |
Failed to rebase ${{ github.repository }} onto ${{ env.UPSTREAM_GIT }}
Check pipeline: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
43 changes: 43 additions & 0 deletions .github/workflows/resubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: resubmit the release

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

jobs:
resubmit:
runs-on: ubuntu-latest
steps:
- name: determine skip
run: |
if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" || $(( RANDOM % 6 )) == 0 ]];
then
echo "SKIP=false" >> $GITHUB_ENV
fi
-
id: version
if: ${{ env.SKIP == 'false' }}
run: |
LATEST_INFO=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest")
echo "::set-output name=file-name-aarch64::$(echo $LATEST_INFO | jq -r '.assets[].name' | grep aarch64)"
echo "::set-output name=file-name-x86_64::$(echo $LATEST_INFO | jq -r '.assets[].name' | grep -E -i -w '(x86_64|any)')"
echo "VERSION=$(echo $LATEST_INFO | jq -r '.tag_name')" >> $GITHUB_ENV
-
name: dispatch_aarch64
if: ${{ env.SKIP == 'false' && steps.version.outputs.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": "${{ steps.version.outputs.file-name-aarch64 }}"}'
-
name: dispatch_x86_64
if: ${{ env.SKIP == 'false' && steps.version.outputs.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": "${{ steps.version.outputs.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/[email protected]
with:
token: ${{ secrets.PUSH_AND_TRIGGER }}
-
name: update pkgbuild
env:
VERSION: ${{ github.event.client_payload.version }}
MD5: ${{ github.event.client_payload.md5 }}
run: |
[ -n "$VERSION" ] && sed -i "/pkgver=/c\pkgver=${VERSION}" PKGBUILD || exit 0
[ -n "$MD5" ] && sed -i "/_sourcemd5=/c\_sourcemd5=${MD5}" PKGBUILD || exit 0
-
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

0 comments on commit 84bc817

Please sign in to comment.