WIP: forgejo-pr branch maintenance #42
|
@ -1,82 +0,0 @@
|
|||
#
|
||||
#
|
||||
# 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
|
||||
# vars.CASCADE_DOCS_FORCE_VERSION
|
||||
# replace the generated documentation for a given version even if it has already
|
||||
# been generated (e.g. v7.0.0-test)
|
||||
#
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
actions:
|
||||
runs-on: self-hosted
|
||||
strategy:
|
||||
matrix:
|
||||
info:
|
||||
- version: v7.0
|
||||
branch: next
|
||||
forgejo: https://codeberg.org
|
||||
repo: forgejo-experimental/forgejo
|
||||
tests: ${{ vars.V7_0_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:
|
||||
FORCE_VERSION: "${{ vars.CASCADE_DOCS_FORCE_VERSION }}"
|
||||
VERSION: "${{ steps.run.outputs.full_version }}"
|
|
@ -1,43 +0,0 @@
|
|||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
packages:
|
||||
runs-on: self-hosted
|
||||
strategy:
|
||||
matrix:
|
||||
info:
|
||||
- version: v7.0
|
||||
branch: next
|
||||
forgejo: https://codeberg.org
|
||||
repo: forgejo-experimental/forgejo
|
||||
tests: ${{ vars.V7_0_TESTS }}
|
||||
- version: v1.21
|
||||
forgejo: https://codeberg.org
|
||||
repo: forgejo/forgejo
|
||||
tests: ${{ vars.V1_21_TESTS }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: https://code.forgejo.org/actions/setup-forgejo@v2
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- name: 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
|
||||
|
||||
export VERBOSE="${{ vars.VERBOSE || false }}"
|
||||
|
||||
su -c "packages/run.sh $binary $full_version ${{ matrix.info.version }} ${{ matrix.info.tests }}" forgejo
|
39
.forgejo/workflows/pr.yml
Normal file
39
.forgejo/workflows/pr.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
info:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
steps:
|
||||
- name: event
|
||||
run: |
|
||||
cat <<'EOF'
|
||||
${{ toJSON(github.event) }}
|
||||
EOF
|
||||
|
||||
actions:
|
||||
runs-on: self-hosted
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: https://code.forgejo.org/actions/setup-forgejo@v2
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- shell: bash
|
||||
run: |
|
||||
set -x
|
||||
forgejo-binary.sh ensure_user forgejo
|
||||
|
||||
export DIR=$(mktemp -d)
|
||||
chown forgejo $DIR /srv
|
||||
|
||||
if test -f forgejo/binary-url ; then
|
||||
su -c "actions/run.sh $(cat forgejo/binary-url) unknown_full_version v7_0" forgejo
|
||||
else
|
||||
echo "forgejo/binary-url does not exist, do nothing"
|
||||
fi
|
|
@ -1,41 +0,0 @@
|
|||
name: upgrade
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
upgrade:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: 'docker.io/node:20-bookworm'
|
||||
steps:
|
||||
- name: cache S3 binaries
|
||||
id: S3
|
||||
uses: https://code.forgejo.org/actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
/usr/local/bin/minio
|
||||
/usr/local/bin/mc
|
||||
/usr/local/bin/garage
|
||||
key: S3
|
||||
|
||||
- name: skip if S3 cache hit
|
||||
if: steps.S3.outputs.cache-hit != 'true'
|
||||
run: echo no hit
|
||||
|
||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.21"
|
||||
- run: |
|
||||
git config --add safe.directory '*'
|
||||
adduser --quiet --comment forgejo --disabled-password forgejo
|
||||
chown -R forgejo:forgejo .
|
||||
- run: |
|
||||
script=$(pwd)/forgejo/upgrades/test-upgrade.sh
|
||||
$script run dependencies
|
||||
$script clobber
|
||||
su forgejo -c "$script test_upgrades"
|
Loading…
Reference in a new issue