Skip to content

Commit 51d5c53

Browse files
committed
feat(ci): cooker now tags latest-cooker (dynamically) and main names releases main-date
1 parent dfbc6f0 commit 51d5c53

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/build_components.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ jobs:
671671
CURRENT_DATE=$(date -u +"%Y%m%d-%H%M")
672672
# Check if the branch is main or not
673673
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
674-
TAG="${CURRENT_DATE}"
674+
TAG="main-${CURRENT_DATE}"
675675
else
676676
TAG="cooker-${CURRENT_DATE}"
677677
fi
@@ -691,6 +691,24 @@ jobs:
691691
repo: ${{ env.REPO_NAME }}
692692
token: ${{ steps.generate-rekku-token.outputs.token }}
693693

694+
- name: Update latest-cooker tag
695+
if: github.ref != 'refs/heads/main'
696+
run: |
697+
git submodule deinit -f --all
698+
git fetch --tags
699+
700+
# Remove local and remote latest-cooker tag if exists
701+
if git rev-parse --verify "latest-cooker" >/dev/null 2>&1; then
702+
git tag -d "latest-cooker" || true
703+
git push --delete origin "latest-cooker" || true
704+
fi
705+
706+
# Create or move latest-cooker to point to the just-created cooker tag
707+
git tag -f "latest-cooker" "${TAG}"
708+
git push -f origin "latest-cooker"
709+
env:
710+
GITHUB_TOKEN: ${{ steps.generate-rekku-token.outputs.token }}
711+
694712
- name: Create diff between target branch and PR components_version_list.md
695713
run: |
696714
if [[ "${GITHUB_BASE_REF}" == "cooker" ]]; then

.github/workflows/delete-old-releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
THRESHOLD_DATE=$(date -u -d "1 month ago" +%Y-%m-%dT%H:%M:%SZ)
3434
3535
# Define the list of tags to be excluded
36-
EXCLUDE_TAGS=("cooker-0.9.0b-ShoujoMonster")
36+
EXCLUDE_TAGS=("latest" "latest-cooker")
3737
3838
# Get latest release ID (so we don't delete the very latest release)
3939
LATEST_RELEASE_ID=$(curl -s -H "Authorization: token ${{ steps.generate-rekku-token.outputs.token }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r '.id // empty')

0 commit comments

Comments
 (0)