perf(ci): use concurrent cnb release sync script for resync
This commit is contained in:
1 file changed
+22
-13
@@ -19,22 +19,31 @@ jobs:
|
||||
name: Sync release to CNB
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Sync release assets to CNB
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Download GitHub release assets
|
||||
env:
|
||||
TAG_NAME: ${{ inputs.tag }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_USERNAME: ${{ github.repository_owner }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CNB_USERNAME: cnb
|
||||
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p "$RUNNER_TEMP/github-release" "$RUNNER_TEMP/release-assets"
|
||||
gh release view "$TAG_NAME" \
|
||||
--repo "$GITHUB_REPOSITORY" \
|
||||
--json tagName,name,body,targetCommitish,isPrerelease,isDraft,assets \
|
||||
> "$RUNNER_TEMP/github-release/release.json"
|
||||
gh release download "$TAG_NAME" \
|
||||
--repo "$GITHUB_REPOSITORY" \
|
||||
--dir "$RUNNER_TEMP/release-assets" \
|
||||
--clobber
|
||||
|
||||
wget -q https://cnb.cool/znb/mpgrm/-/releases/download/v0.1.0/mpgrm_linux_amd64.tar.gz
|
||||
tar -xf mpgrm_linux_amd64.tar.gz
|
||||
chmod +x mpgrm
|
||||
|
||||
./mpgrm releases sync \
|
||||
--repo "https://github.com/${GITHUB_REPOSITORY}.git" \
|
||||
--target-repo "https://cnb.cool/${CNB_REPOSITORY}.git" \
|
||||
--tags "${TAG_NAME}"
|
||||
- name: Sync release assets to CNB
|
||||
env:
|
||||
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
|
||||
CNB_UPLOAD_CONCURRENCY: "3"
|
||||
run: |
|
||||
node .github/scripts/sync-cnb-release.mjs \
|
||||
--github-release "$RUNNER_TEMP/github-release/release.json" \
|
||||
--assets-dir "$RUNNER_TEMP/release-assets"
|
||||
Reference in new issue
Block a user