78 lines
2.8 KiB
YAML
78 lines
2.8 KiB
YAML
#
|
|
#
|
|
# https://code.forgejo.org/forgejo/end-to-end/settings/actions
|
|
#
|
|
# secrets.CASCADE_DOCS_ORIGIN_TOKEN
|
|
# https://code.forgejo.org/forgejo-ci scope write:issue, read:repository, read:user
|
|
# vars.CASCADE_DOCS_DESTINATION_DOER
|
|
# forgejo-cascading-pr (https://codeberg.org/forgejo-cascading-pr)
|
|
# secrets.CASCADE_DOCS_DESTINATION_TOKEN
|
|
# https://codeberg.org/forgejo-cascading-pr scope write:issue, write:repository, read:user
|
|
#
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
|
|
jobs:
|
|
actions:
|
|
runs-on: self-hosted
|
|
strategy:
|
|
matrix:
|
|
info:
|
|
- version: v1.22
|
|
branch: next
|
|
forgejo: https://codeberg.org
|
|
repo: forgejo-experimental/forgejo
|
|
tests: ${{ vars.V1_22_TESTS }}
|
|
- version: v1.21
|
|
forgejo: https://codeberg.org
|
|
repo: forgejo/forgejo
|
|
tests: ${{ vars.V1_21_TESTS }}
|
|
- version: v1.20
|
|
forgejo: https://codeberg.org
|
|
repo: forgejo/forgejo
|
|
tests: ${{ vars.V1_20_TESTS }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: https://code.forgejo.org/actions/setup-forgejo@v2
|
|
with:
|
|
install-only: true
|
|
|
|
- name: run
|
|
id: run
|
|
if: matrix.info.tests != 'none'
|
|
shell: bash
|
|
run: |
|
|
set -x
|
|
forgejo-binary.sh ensure_user forgejo
|
|
full_version=$(curl -sS ${{ matrix.info.forgejo }}/api/v1/repos/${{ matrix.info.repo }}/releases | jq -r '.[] | .tag_name | select(startswith("${{ matrix.info.version }}"))' | sort -r | head -1)
|
|
binary=${{ matrix.info.forgejo }}/${{ matrix.info.repo }}/releases/download/${full_version}/forgejo-${full_version#v}-linux-amd64
|
|
|
|
export DIR=$(mktemp -d)
|
|
chown forgejo $DIR /srv
|
|
|
|
su -c "actions/run.sh $binary $full_version ${{ matrix.info.version }} ${{ matrix.info.tests }}" forgejo
|
|
|
|
echo full_version="$full_version" >> $GITHUB_OUTPUT
|
|
|
|
- name: update documentation
|
|
if: matrix.info.tests != 'none' && github.ref == 'refs/heads/main'
|
|
uses: https://code.forgejo.org/actions/cascading-pr@v1
|
|
with:
|
|
origin-url: ${{ env.GITHUB_SERVER_URL }}
|
|
origin-repo: ${{ github.repository }}
|
|
origin-token: ${{ secrets.CASCADE_DOCS_ORIGIN_TOKEN }}
|
|
origin-ref: refs/heads/main
|
|
destination-url: https://codeberg.org
|
|
destination-fork-repo: ${{ vars.CASCADE_DOCS_DESTINATION_DOER }}/docs
|
|
destination-repo: forgejo/docs
|
|
destination-branch: ${{ matrix.info.branch || matrix.info.version }}
|
|
destination-token: ${{ secrets.CASCADE_DOCS_DESTINATION_TOKEN }}
|
|
prefix: ${{ env.GITHUB_REPOSITORY }}-${{ matrix.info.version }}
|
|
update: .forgejo/cascading-docs
|
|
env:
|
|
VERSION: "${{ steps.run.outputs.full_version }}"
|