refactor: move to single-repo pattern for releases
This commit is contained in:
@@ -115,6 +115,9 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
[ "$SKIP_BUILD" = "true" ] && exit 0
|
[ "$SKIP_BUILD" = "true" ] && exit 0
|
||||||
|
# Push tag to GitHub first so it exists before creating the release
|
||||||
|
git remote add github-release https://x-access-token:${{ secrets.GH_PAT }}@github.com/cpfarhood/headlamp-polaris-plugin.git 2>/dev/null || true
|
||||||
|
git push -f github-release ${GITHUB_REF_NAME} 2>/dev/null || true
|
||||||
GH_API="https://api.github.com/repos/cpfarhood/headlamp-polaris-plugin"
|
GH_API="https://api.github.com/repos/cpfarhood/headlamp-polaris-plugin"
|
||||||
# Create release or fetch existing one
|
# Create release or fetch existing one
|
||||||
BODY=$(curl -s -X POST \
|
BODY=$(curl -s -X POST \
|
||||||
@@ -172,7 +175,7 @@ jobs:
|
|||||||
git fetch origin ${GITEA_BRANCH}
|
git fetch origin ${GITEA_BRANCH}
|
||||||
git checkout origin/${GITEA_BRANCH} -B temp-update
|
git checkout origin/${GITEA_BRANCH} -B temp-update
|
||||||
sed -i "s|headlamp/plugin/archive-checksum:.*|headlamp/plugin/archive-checksum: sha256:${CHECKSUM}|" artifacthub-pkg.yml
|
sed -i "s|headlamp/plugin/archive-checksum:.*|headlamp/plugin/archive-checksum: sha256:${CHECKSUM}|" artifacthub-pkg.yml
|
||||||
sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"https://github.com/${GITHUB_REPO}/releases/download/${GITHUB_REF_NAME}/headlamp-polaris-plugin-${VERSION}.tar.gz\"|" artifacthub-pkg.yml
|
sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"https://github.com/cpfarhood/headlamp-polaris-plugin/releases/download/${GITHUB_REF_NAME}/headlamp-polaris-plugin-${VERSION}.tar.gz\"|" artifacthub-pkg.yml
|
||||||
sed -i "s|^version:.*|version: ${VERSION}|" artifacthub-pkg.yml
|
sed -i "s|^version:.*|version: ${VERSION}|" artifacthub-pkg.yml
|
||||||
git add artifacthub-pkg.yml
|
git add artifacthub-pkg.yml
|
||||||
git diff --cached --quiet || {
|
git diff --cached --quiet || {
|
||||||
@@ -185,8 +188,9 @@ jobs:
|
|||||||
git tag -f ${GITHUB_REF_NAME}
|
git tag -f ${GITHUB_REF_NAME}
|
||||||
git push -f origin ${GITHUB_REF_NAME}
|
git push -f origin ${GITHUB_REF_NAME}
|
||||||
# Also push to GitHub directly to avoid waiting for mirror sync
|
# Also push to GitHub directly to avoid waiting for mirror sync
|
||||||
# Dev versions go to main branch of dev repo, stable versions to main of main repo
|
# Single repo pattern: both stable and dev releases go to same GitHub repo
|
||||||
git remote add github https://x-access-token:${{ secrets.GH_PAT }}@github.com/${GITHUB_REPO}.git 2>/dev/null || true
|
# ArtifactHub will differentiate based on prerelease flag in metadata
|
||||||
|
git remote add github https://x-access-token:${{ secrets.GH_PAT }}@github.com/cpfarhood/headlamp-polaris-plugin.git 2>/dev/null || true
|
||||||
git push github temp-update:main 2>/dev/null || true
|
git push github temp-update:main 2>/dev/null || true
|
||||||
git push -f github ${GITHUB_REF_NAME} 2>/dev/null || true
|
git push -f github ${GITHUB_REF_NAME} 2>/dev/null || true
|
||||||
echo "Tag ${GITHUB_REF_NAME} aligned with updated metadata"
|
echo "Tag ${GITHUB_REF_NAME} aligned with updated metadata"
|
||||||
|
|||||||
Reference in New Issue
Block a user