50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
name: Register plugin release
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
repository:
|
|
description: Plugin repository (owner/name)
|
|
required: true
|
|
type: string
|
|
tag:
|
|
description: Published release tag
|
|
required: true
|
|
type: string
|
|
jobs:
|
|
register:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Check out catalog from Gitea
|
|
env:
|
|
CHECKOUT_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
run: |
|
|
set -eu
|
|
auth_script=$(mktemp)
|
|
trap 'rm -f "$auth_script"' EXIT
|
|
cat > "$auth_script" <<'AUTH'
|
|
#!/bin/sh
|
|
case "$1" in
|
|
*Username*) printf '%s\n' x-access-token ;;
|
|
*) printf '%s\n' "$CHECKOUT_TOKEN" ;;
|
|
esac
|
|
AUTH
|
|
chmod 700 "$auth_script"
|
|
GIT_ASKPASS="$auth_script" GIT_TERMINAL_PROMPT=0 git clone --quiet --depth 1 --branch main "$GITEA_SERVER_URL/trove/curios.git" catalog
|
|
- name: Register completed release
|
|
working-directory: catalog
|
|
run: |
|
|
source tools/ci-runtime.sh
|
|
node tools/sync-release.mjs --publish
|
|
env:
|
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
GITEA_TOKEN: ${{ secrets.PLUGIN_RELEASE_TOKEN }}
|
|
CATALOG_WRITE_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
CATALOG_REPOSITORY: ${{ gitea.repository }}
|
|
RELEASE_REPOSITORY: ${{ inputs.repository }}
|
|
RELEASE_TAG: ${{ inputs.tag }}
|
|
NPM_REGISTRY: ${{ vars.NPM_REGISTRY }}
|
|
NODE_MIRROR: ${{ vars.NODE_MIRROR }}
|