Skip to content

Commit

Permalink
Bump github actions deps
Browse files Browse the repository at this point in the history
Signed-off-by: Cyclinder Kuo <[email protected]>
  • Loading branch information
cyclinder committed Feb 24, 2025
1 parent c835d2f commit 99209ea
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 158 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/auto-upgrade-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,13 @@ jobs:
run: |
bash ./test/scripts/install-tools.sh
- name: Download old spiderpool-agent image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }}
- name: Download old spiderpool-agent and spiderpool-controller image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }}
if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.8
with:
name: old-image-tar-spiderpool-agent
path: test/.download

- name: Download old spiderpool-controller image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }}
if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }}
uses: actions/download-artifact@v3
with:
name: old-image-tar-spiderpool-controller
path: test/.download
merge-multiple: true
pattern: old-image-tar-spiderpool-*-${{ needs.call_build_old_ci_image.outputs.imageTag }}

- name: Load Images
if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }}
Expand Down Expand Up @@ -306,17 +300,12 @@ jobs:
mkdir -p ${{ env.KUBECONFIG_PATH }}/${{ env.E2E_CLUSTER_NAME }}/.kube/
cp -r /tmp/config ${{ env.KUBECONFIG_PATH }}/${{ env.E2E_CLUSTER_NAME }}/.kube/config
- name: Download new spiderpool-agent image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
uses: actions/download-artifact@v3
with:
name: new-image-tar-spiderpool-agent
path: test/.download

- name: Download new spiderpool-controller image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
uses: actions/download-artifact@v3
- name: Download new spiderpool-agent and spiderpool-controller image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
uses: actions/[email protected]
with:
name: new-image-tar-spiderpool-controller
path: test/.download
pattern: new-image-tar-spiderpool-*-${{ needs.call_build_new_ci_image.outputs.imageTag }}
merge-multiple: true

- name: Load Images with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
run: |
Expand Down Expand Up @@ -377,15 +366,15 @@ jobs:
- name: Upload e2e log
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' }}
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4.6.0
with:
name: ${{ needs.get_ref.outputs.old_version }}-to-${{ needs.get_ref.outputs.new_version }}-debuglog.txt
path: test/e2edebugLog.txt
retention-days: 7

- name: Upload e2e report
if: ${{ env.UPLOAD_E2E_REPORT == 'true' }}
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4.6.0
with:
name: ${{ needs.get_ref.outputs.old_version }}-to-${{ needs.get_ref.outputs.new_version }}-e2ereport.json
path: e2ereport.json
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/auto-version-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
(( $? !=0 )) && echo "error, failed to create label ${mainLabelName}"
build-release-image:
needs: get-tag
needs: [get-tag]
uses: ./.github/workflows/call-release-image.yaml
with:
ref: ${{ needs.get-tag.outputs.tag }}
Expand Down Expand Up @@ -137,15 +137,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download Chart Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.8
with:
name: ${{ needs.release-chart.outputs.artifact }}
name: ${{ needs.release-chart.outputs.artifact }}_${{ needs.get-tag.outputs.tag }}
path: chart-package/

- name: Download Changelog Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.8
with:
name: ${{ needs.release-changelog.outputs.artifact }}
name: ${{ needs.release-changelog.outputs.artifact }}_${{ needs.get-tag.outputs.tag }}
path: changelog-result/

- name: Get Downloaded Files
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/build-image-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ jobs:
- name: Generating Base Image Tag
id: base_tag
run: |
echo ::set-output name=tag::"$(git ls-tree --full-tree HEAD -- ./${{ env.IMAGE_ROOT_PATH }}/${{ env.IMAGE_NAME }} | awk '{ print $3 }')"
echo "tag=$(git ls-tree --full-tree HEAD -- ./${{ env.IMAGE_ROOT_PATH }}/${{ env.IMAGE_NAME }} | awk '{ print $3 }')" >> $GITHUB_ENV
# check whether we have upload the same base image to online register , if so, we could not build it
- name: Checking if tag already exists
id: tag-in-repositories
shell: bash
run: |
if docker buildx imagetools inspect ${{ env.ONLINE_REGISTER }}/${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ steps.base_tag.outputs.tag }} &>/dev/null; then
if docker buildx imagetools inspect ${{ env.ONLINE_REGISTER }}/${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ env.tag }} &>/dev/null; then
echo ::set-output name=exists::"true"
echo "the target base image exist , no need to build it "
else
Expand All @@ -106,7 +106,7 @@ jobs:

- name: Release build ${{ env.IMAGE_NAME }}
if: ${{ steps.tag-in-repositories.outputs.exists == 'false' }}
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
continue-on-error: false
id: docker_build_release
with:
Expand All @@ -117,7 +117,7 @@ jobs:
github-token: ${{ secrets.WELAN_PAT }}
platforms: ${{ env.BUILD_PLATFORM }}
tags: |
${{ env.ONLINE_REGISTER }}/${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ steps.base_tag.outputs.tag }}
${{ env.ONLINE_REGISTER }}/${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ env.tag }}
- name: Image Release Digest
if: ${{ steps.tag-in-repositories.outputs.exists == 'false' }}
Expand All @@ -126,14 +126,14 @@ jobs:
mkdir -p image-digest/
echo "## ${{ env.IMAGE_NAME }}" > image-digest/${{ env.IMAGE_NAME }}.txt
echo "" >> image-digest/${{ env.IMAGE_NAME }}.txt
echo "\`${{ env.ONLINE_REGISTER }}/${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ steps.base_tag.outputs.tag }}@${{ steps.docker_build_release.outputs.digest }}\`" >> image-digest/${{ env.IMAGE_NAME }}.txt
echo "\`${{ env.ONLINE_REGISTER }}/${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ env.tag }}@${{ steps.docker_build_release.outputs.digest }}\`" >> image-digest/${{ env.IMAGE_NAME }}.txt
echo "" >> image-digest/${{ env.IMAGE_NAME }}.txt
- name: Upload artifact digests
if: ${{ steps.tag-in-repositories.outputs.exists == 'false' }}
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4.6.0
with:
name: image-digest ${{ env.IMAGE_NAME }}
name: image-digest ${{ env.IMAGE_NAME }}-${{ env.tag }}
path: image-digest
retention-days: 1

Expand All @@ -148,9 +148,11 @@ jobs:
mkdir -p image-digest/
- name: Download digests of all images built
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.8
with:
path: image-digest/
pattern: image-digest-${{ env.IMAGE_NAME }}-${{ env.tag }}
merge-multiple: true

- name: Image Digests Output
shell: bash
Expand Down
89 changes: 42 additions & 47 deletions .github/workflows/build-image-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
# run if filters.src was changed
outputs:
imageTag: ${{ steps.tag.outputs.tag }}
imageTag: ${{ env.tag }}
e2e: ${{ steps.tag.outputs.e2e }}
strategy:
matrix:
Expand All @@ -65,29 +65,29 @@ jobs:
echo ${{ github.event_name }}
if ${{ inputs.ref != '' }}; then
echo "trigger by workflow_call"
echo ::set-output name=tag::${{ inputs.ref }}
echo ::set-output name=push::${{ inputs.push }}
echo "tag=${{ inputs.ref }}" >> $GITHUB_ENV
echo "push=${{ inputs.push }}" >> $GITHUB_ENV
elif ${{ github.event_name == 'push' }} ; then
echo "trigger by push"
echo ::set-output name=tag::${{ github.sha }}
echo ::set-output name=push::false
echo "tag=${{ github.sha }}" >> $GITHUB_ENV
echo "push=false" >> $GITHUB_ENV
elif ${{ github.event_name == 'pull_request_target' }} ; then
echo "trigger by pull_request_target"
echo ::set-output name=tag::${{ github.event.pull_request.head.sha }}
echo ::set-output name=push::false
echo "tag=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "push=false" >> $GITHUB_ENV
elif ${{ github.event_name == 'workflow_run' }} ; then
echo "trigger by workflow_run"
echo ::set-output name=tag::main
echo ::set-output name=push::false
echo "tag=main" >> $GITHUB_ENV
echo "push=false" >> $GITHUB_ENV
else
echo "trigger by ${{ github.event_name }}"
echo ::set-output name=tag::${{ github.sha }}
echo ::set-output name=push::false
echo "tag=${{ github.sha }}" >> $GITHUB_ENV
echo "push=false" >> $GITHUB_ENV
fi
- name: Login to online register
uses: docker/[email protected]
if: ${{ steps.tag.outputs.push == 'true' }}
if: ${{ env.push == 'true' }}
with:
username: ${{ env.ONLINE_REGISTER_USER }}
password: ${{ env.ONLINE_REGISTER_PASSWORD }}
Expand All @@ -98,7 +98,7 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ steps.tag.outputs.tag }}
ref: ${{ env.tag }}

- name: Getting Build Arg
id: arg
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
# Import GitHub's cache build to docker cache
- name: Copy ${{ matrix.name }} Golang cache to docker cache
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
with:
context: /tmp/.cache/${{ matrix.name }}
file: ./images/cache/Dockerfile
Expand All @@ -148,7 +148,7 @@ jobs:
# build normal image
- name: CI Build ${{ matrix.name }}
if: ${{ github.event_name != 'pull_request_target' }}
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
continue-on-error: false
id: docker_build_ci_master
with:
Expand All @@ -157,21 +157,21 @@ jobs:
# Only push when the event name was a GitHub push, this is to avoid
# re-pushing the image tags when we only want to re-create the Golang
# docker cache after the workflow "Image CI Cache Cleaner" was terminated.
push: ${{ steps.tag.outputs.push }}
push: ${{ env.push }}
provenance: false
platforms: linux/amd64,linux/arm64
github-token: ${{ secrets.WELAN_PAT }}
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}
build-args: |
GIT_COMMIT_VERSION=${{ steps.arg.outputs.commitver }}
GIT_COMMIT_TIME=${{ steps.arg.outputs.committime }}
VERSION=${{ steps.tag.outputs.tag }}
VERSION=${{ env.tag }}
# build debug image who turn on race and deadlock detection
- name: CI race detection Build ${{ matrix.name }}
if: ${{ github.event_name != 'pull_request_target' }}
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
continue-on-error: false
id: docker_build_ci_master_detect_race_condition
with:
Expand All @@ -180,95 +180,95 @@ jobs:
# Only push when the event name was a GitHub push, this is to avoid
# re-pushing the image tags when we only want to re-create the Golang
# docker cache after the workflow "Image CI Cache Cleaner" was terminated.
push: ${{ steps.tag.outputs.push }}
push: ${{ env.push }}
platforms: linux/amd64
outputs: type=docker,dest=/tmp/${{ matrix.name }}-race.tar
github-token: ${{ secrets.WELAN_PAT }}
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}-race
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}-race
build-args: |
RACE=1
GIT_COMMIT_VERSION=${{ steps.arg.outputs.commitver }}
GIT_COMMIT_TIME=${{ steps.arg.outputs.committime }}
VERSION=${{ steps.tag.outputs.tag }}
VERSION=${{ env.tag }}
- name: CI Image Releases digests
if: ${{ github.event_name != 'pull_request_target' }}
shell: bash
run: |
mkdir -p image-digest/
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}@${{ steps.docker_build_ci_master.outputs.digest }}" > image-digest/${{ matrix.name }}.txt
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}-race@${{ steps.docker_build_ci_master_detect_race_condition.outputs.digest }}" >> image-digest/${{ matrix.name }}.txt
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}@${{ steps.docker_build_ci_master.outputs.digest }}" > image-digest/${{ matrix.name }}.txt
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}-race@${{ steps.docker_build_ci_master_detect_race_condition.outputs.digest }}" >> image-digest/${{ matrix.name }}.txt
# =========== trigger by PR updates , build 2 images
- name: CI Build ${{ matrix.name }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
continue-on-error: false
id: docker_build_ci_pr
with:
context: .
file: ${{ matrix.dockerfile }}
push: ${{ steps.tag.outputs.push }}
push: ${{ env.push }}
provenance: false
github-token: ${{ secrets.WELAN_PAT }}
platforms: linux/amd64,linux/arm64
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}
build-args: |
GIT_COMMIT_VERSION=${{ steps.arg.outputs.commitver }}
GIT_COMMIT_TIME=${{ steps.arg.outputs.committime }}
VERSION=${{ steps.tag.outputs.tag }}
VERSION=${{ env.tag }}
- name: CI race detection Build ${{ matrix.name }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
continue-on-error: false
id: docker_build_ci_pr_detect_race_condition
with:
context: .
file: ${{ matrix.dockerfile }}
push: ${{ steps.tag.outputs.push }}
push: ${{ env.push }}
platforms: linux/amd64
github-token: ${{ secrets.WELAN_PAT }}
outputs: type=docker,dest=/tmp/${{ matrix.name }}-race.tar
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}-race
${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}-race
build-args: |
RACE=1
GIT_COMMIT_VERSION=${{ steps.arg.outputs.commitver }}
GIT_COMMIT_TIME=${{ steps.arg.outputs.committime }}
VERSION=${{ steps.tag.outputs.tag }}
VERSION=${{ env.tag }}
- name: CI Image Releases digests
if: ${{ github.event_name == 'pull_request_target' }}
shell: bash
run: |
mkdir -p image-digest/
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}@${{ steps.docker_build_ci_pr.outputs.digest }}" > image-digest/${{ matrix.name }}.txt
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ steps.tag.outputs.tag }}-race@${{ steps.docker_build_ci_pr_detect_race_condition.outputs.digest }}" >> image-digest/${{ matrix.name }}.txt
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}@${{ steps.docker_build_ci_pr.outputs.digest }}" > image-digest/${{ matrix.name }}.txt
echo "${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci:${{ env.tag }}-race@${{ steps.docker_build_ci_pr_detect_race_condition.outputs.digest }}" >> image-digest/${{ matrix.name }}.txt
# Upload artifact digests
- name: Upload artifact digests
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4.6.0
with:
name: image-digest-${{ matrix.name }}
name: image-digest-${{ matrix.name }}-${{ env.tag }}
path: image-digest
retention-days: 1

# Upload artifact race images tar
- name: Upload artifact race image tar
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4.6.0
with:
name: ${{ inputs.imageTarName }}-${{ matrix.name }}
name: ${{ inputs.imageTarName }}-${{ matrix.name }}-${{ env.tag }}
path: /tmp/${{ matrix.name }}-race.tar
retention-days: 1

# ============= restore cache ===========
# Store docker's golang's cache build locally only on the main branch
- name: Store ${{ matrix.name }} Golang cache build locally
if: ${{ github.event_name != 'pull_request_target' && steps.cache.outputs.cache-hit != 'true' }}
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.13.0
with:
context: .
file: ./images/cache/Dockerfile
Expand Down Expand Up @@ -301,16 +301,11 @@ jobs:
mkdir -p image-digest/
- name: Download digests of all images built
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.8
with:
pattern: image-digest-spiderpool-*-${{ needs.build_and_push_prs.outputs.imageTag }}
path: image-digest/
name: image-digest-spiderpool-agent

- name: Download digests of all images built
uses: actions/download-artifact@v3
with:
path: image-digest/
name: image-digest-spiderpool-controller
merge-multiple: true

- name: Image Digests Output
shell: bash
Expand Down
Loading

0 comments on commit 99209ea

Please sign in to comment.