refactor: switch to single-repo automation
This commit is contained in:
@@ -27,17 +27,6 @@ jobs:
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Validate token
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
if [ -z "${GITEA_TOKEN}" ]; then
|
||||
echo "Warning: missing GITEA_TOKEN, release publish step will fail."
|
||||
else
|
||||
echo "GITEA_TOKEN exists."
|
||||
fi
|
||||
|
||||
- name: Prepare config
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -56,7 +45,6 @@ jobs:
|
||||
- name: Sync upstream and generate rules
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
UPSTREAM_REF: ${{ vars.UPSTREAM_REF }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -89,41 +77,5 @@ jobs:
|
||||
else
|
||||
git commit -m "chore: daily sync and generate rules"
|
||||
git push origin "HEAD:${branch}"
|
||||
echo "builder_changed=true" >> "$GITHUB_ENV"
|
||||
echo "builder_changed=true"
|
||||
fi
|
||||
|
||||
- name: Publish dist to release repo
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_BASE_URL: ${{ vars.GITEA_BASE_URL }}
|
||||
GITEA_USERNAME: ${{ vars.GITEA_USERNAME }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
TARGET_OWNER: ${{ vars.TARGET_OWNER }}
|
||||
TARGET_REPO: ${{ vars.TARGET_REPO }}
|
||||
TARGET_BRANCH: ${{ vars.TARGET_BRANCH }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "${GITEA_TOKEN}" ]; then
|
||||
echo "Missing secret GITEA_TOKEN for release publish" >&2
|
||||
exit 1
|
||||
fi
|
||||
base="${GITEA_BASE_URL:-https://git.halonice.com}"
|
||||
base="${base%/}"
|
||||
username="${GITEA_USERNAME:-yuanzhen869}"
|
||||
owner="${TARGET_OWNER:-yuanzhen869}"
|
||||
repo="${TARGET_REPO:-shunt-rules-release}"
|
||||
branch="${TARGET_BRANCH:-main}"
|
||||
|
||||
if [[ "${base}" == https://* ]]; then
|
||||
release_url="https://${username}:${GITEA_TOKEN}@${base#https://}/${owner}/${repo}.git"
|
||||
elif [[ "${base}" == http://* ]]; then
|
||||
release_url="http://${username}:${GITEA_TOKEN}@${base#http://}/${owner}/${repo}.git"
|
||||
else
|
||||
echo "GITEA_BASE_URL must start with http:// or https://" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_REPO_URL="${release_url}" \
|
||||
TARGET_BRANCH="${branch}" \
|
||||
COMMIT_MESSAGE="chore: daily publish generated rules" \
|
||||
bash scripts/release_dist.sh
|
||||
|
||||
Reference in New Issue
Block a user