diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..583decf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..d8cd71d --- /dev/null +++ b/.github/settings.yml @@ -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/flashfocus-git.git +# you can extend settings using https://probot.github.io/apps/settings/ diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml new file mode 100644 index 0000000..6f92351 --- /dev/null +++ b/.github/workflows/bootstrap.yml @@ -0,0 +1,20 @@ +name: bootstrap +on: + workflow_dispatch: + schedule: + - cron: '0 1-23/2 * * *' + +jobs: + botstrap_actions: + runs-on: ubuntu-latest + steps: + - + name: checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.BOOTSTRAP_WORKFLOWS }} + - + id: bootstrap + uses: Manjaro-Sway/bootstrap-package-actions@master + with: + upstream: "https://aur.archlinux.org/flashfocus-git.git" \ No newline at end of file diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml new file mode 100644 index 0000000..68a6d57 --- /dev/null +++ b/.github/workflows/contributors.yml @@ -0,0 +1,19 @@ +name: "forward-all-contributors" +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +jobs: + add-contributors: + runs-on: ubuntu-latest + steps: + - name: create comment in target repo + uses: peter-evans/create-or-update-comment@v2 + 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 }} diff --git a/.github/workflows/increment-rel.yml b/.github/workflows/increment-rel.yml new file mode 100644 index 0000000..0f746c5 --- /dev/null +++ b/.github/workflows/increment-rel.yml @@ -0,0 +1,38 @@ +name: increment pkgrel + +on: + workflow_dispatch: + inputs: + pkgrel: + description: 'pkgrel to set - will iterate if not given' + required: false + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + increment: + runs-on: ubuntu-latest + steps: + - + name: checkout + uses: actions/checkout@v3.0.2 + 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 info@manjaro-sway.download + - + name: commit + run: | + git add PKGBUILD + git commit -m "release: increment rel" + git push diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml new file mode 100644 index 0000000..0f2a596 --- /dev/null +++ b/.github/workflows/pkgbuild.yml @@ -0,0 +1,43 @@ +name: pkgbuild + +on: + workflow_dispatch: + inputs: + force-update: + description: 'update artifacts' + required: false + default: 'false' + push: + branches: + - master + - main + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +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@v3.0.2 + - 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 }} diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 0000000..a582774 --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,46 @@ +name: rebase + +on: + workflow_dispatch: + schedule: + - cron: '*/30 * * * *' + +env: + UPSTREAM_GIT: https://aur.archlinux.org/flashfocus-git.git + +jobs: + rebase: + runs-on: ubuntu-latest + steps: + - + name: checkout + uses: actions/checkout@v3.0.2 + 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 "info@manjaro-sway.download" + 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}} diff --git a/.github/workflows/resubmit.yml b/.github/workflows/resubmit.yml new file mode 100644 index 0000000..27053b1 --- /dev/null +++ b/.github/workflows/resubmit.yml @@ -0,0 +1,47 @@ +name: resubmit the release + +on: + workflow_dispatch: + schedule: + - cron: '20 1-23/2 * * *' + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +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@v2 + 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@v2 + 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 }}"}' diff --git a/.github/workflows/set-version.yml b/.github/workflows/set-version.yml new file mode 100644 index 0000000..28c0e6c --- /dev/null +++ b/.github/workflows/set-version.yml @@ -0,0 +1,36 @@ +name: set version to src version + +on: + repository_dispatch: + types: [source_update] + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + update-version: + runs-on: ubuntu-latest + steps: + - + name: check out the repo + id: checkout_repo + uses: actions/checkout@v3.0.2 + 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 "info@manjaro-sway.download" + git add PKGBUILD + git commit -m "chore: release version ${{ github.event.client_payload.version }}" + git push