Skip to content

Commit

Permalink
chore: delete release schedule (#3967)
Browse files Browse the repository at this point in the history
  • Loading branch information
JashBook authored Jun 27, 2023
1 parent 869cd4d commit d4c9c2f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/utils/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Usage: $(basename "$0") <options>
14) ignore cover pkgs
15) set size label
16) get test packages
17) delete actions cache
-tn, --tag-name Release tag name
-gr, --github-repo Github Repo
-gt, --github-token Github token
Expand Down Expand Up @@ -122,6 +123,9 @@ main() {
16)
get_test_packages
;;
17)
delete_actions_cache
;;
*)
show_help
break
Expand Down Expand Up @@ -616,4 +620,10 @@ get_test_packages() {
echo $TEST_PACKAGES
}

delete_actions_cache() {
gh extension install actions/gh-actions-cache --force

gh actions-cache delete --repo $LATEST_REPO $TAG_NAME --confirm
}

main "$@"
14 changes: 12 additions & 2 deletions .github/workflows/release-delete.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: RELEASE-DELETE

on:
schedule:
- cron: '18 0 * * 1-5'
workflow_dispatch:
inputs:
release-version:
Expand All @@ -10,8 +12,16 @@ on:

jobs:
delete-release:
uses: apecloud/apecloud-cd/.github/workflows/release-delete.yml@v0.1.0
if: github.event_name != 'schedule'
uses: apecloud/apecloud-cd/.github/workflows/release-delete.yml@v0.1.5
with:
VERSION: "${{ inputs.release-version }}"
APECD_REF: "v0.1.0"
APECD_REF: "v0.1.5"
secrets: inherit

delete-release-schedule:
if: github.event_name == 'schedule'
uses: apecloud/apecloud-cd/.github/workflows/release-delete-schedule.yml@v0.1.5
with:
APECD_REF: "v0.1.5"
secrets: inherit
5 changes: 5 additions & 0 deletions .github/workflows/release-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ jobs:
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- name: delete cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.send_message.outputs.release-result }}"
- name: Save Artifact
id: cache-artifact-save
uses: actions/cache/save@v3
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ jobs:
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- name: delete cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.send_message.outputs.release-result }}"
- name: Save Artifact
id: cache-artifact-save
uses: actions/cache/save@v3
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ jobs:
echo tag_name=${{ env.TAG_NAME }} >> $GITHUB_OUTPUT
- name: delete cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.send_message.outputs.release-result }}"
- name: Save Artifact
id: cache-artifact-save
uses: actions/cache/save@v3
Expand Down Expand Up @@ -232,4 +237,15 @@ jobs:
APECD_REF: "v0.1.4"
VERSION: "${{ needs.send-message.outputs.tag-name }}"
secrets: inherit


delete-cache:
needs: e2e-kbcli
runs-on: ubuntu-latest
strategy:
matrix:
type: [image, kbcli, chart]
steps:
- name: delete ${{ matrix.type }} cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ env.TAG_NAME }}-${{ matrix.type }}"

0 comments on commit d4c9c2f

Please sign in to comment.