@@ -21,10 +21,13 @@ permissions:
2121jobs :
2222 github-release :
2323 name : Create Github Release
24- runs-on : ubuntu-latest
24+ runs-on : [self-hosted, linux, x64]
2525 outputs :
2626 version : ${{ steps.meta.outputs.version }}
27- is_nightly : ${{ steps.meta.outputs.is_nightly }}
27+ ref_slug : ${{ steps.meta.outputs.ref_slug }}
28+ default_branch_slug : ${{ steps.meta.outputs.default_branch_slug }}
29+
30+ is_pre_release : ${{ steps.meta.outputs.is_pre_release }}
2831 steps :
2932 - name : Checkout
3033 uses : actions/checkout@v4
@@ -35,46 +38,37 @@ jobs:
3538 - uses : nxtcoder17/actions/metadata@main
3639 id : meta
3740
38- - name : create nightly github release (if applicable)
39- shell : bash
40- if : ${{ steps.meta.outputs.is_nightly == 'true' }}
41- env :
42- GH_TOKEN : ${{ github.token }}
43- version : ${{steps.meta.outputs.version}}
44- run : |+
45- echo "🔖 recreating release for nightly tag ${{ steps.meta.outputs.version }}"
46- gh release delete ${{steps.meta.outputs.version}} -y --cleanup-tag -R ${{ github.repository }} || echo "cleaned up ${{steps.meta.outputs.version}} tag"
47- gh release create "${{steps.meta.outputs.version}}" -R "${{ github.repository }}" --generate-notes --prerelease
41+ - name : create github release
42+ uses : nxtcoder17/actions/github-release-create@main
43+ with :
44+ name : ${{steps.meta.outputs.version}}
45+ github_token : ${{github.token}}
46+ pre_release : ${{ steps.meta.outputs.is_pre_release }}
4847
49- - name : upload kubernetes CRDs to github release
48+ - name : create unified CRDs file
5049 shell : bash
51- env :
52- GH_TOKEN : ${{ github.token }}
53- version : ${{steps.meta.outputs.version}}
5450 run : |+
5551 for file in $(ls config/crd/bases/); do
5652 cat config/crd/bases/$file >> crds.yml
5753 done
5854
59- opts=("-R" "${{github.repository}}")
60- if [ "${{ steps.meta.outputs.is_nightly }}" = "true" ]; then
61- opts+=("--clobber")
62- fi
63-
64- gh release upload "${{ steps.meta.outputs.version }}" ${opts[@]} crds.yml
55+ - name : upload kubernetes CRDs to github release
56+ uses : nxtcoder17/actions/github-release-upload@main
57+ with :
58+ name : ${{steps.meta.outputs.version}}
59+ github_token : ${{github.token}}
60+ files : |+
61+ crds.yml
6562
66- build-container- image :
63+ build-image :
6764 strategy :
6865 fail-fast : true
6966 matrix :
70- arch :
71- - amd64
72- - arm64
7367 include :
7468 - arch : amd64
75- runner : ubuntu-latest
69+ runs-on : [self-hosted, linux, x64]
7670 - arch : arm64
77- runner : ubuntu-24.04-arm
71+ runs-on : [self-hosted, linux, ARM64]
7872
7973 runs-on : ${{ matrix.runner }}
8074 name : Build Container Image
@@ -96,24 +90,23 @@ jobs:
9690 - name : docker build and push
9791 env :
9892 image : " ghcr.io/${{ github.repository }}/controller:${{ needs.github-release.outputs.version }}-${{ matrix.arch }}"
99- buildx_cache : " ghcr.io/${{ github.repository }}/controller:__docker__buildx__cache__${{ matrix.arch }}__${{needs.github-release.outputs.version}}"
93+ buildx_cache : " ghcr.io/${{ github.repository }}/controller:buildx-cache-${{needs.github-release.outputs.ref_slug}}-${{matrix.arch}}"
94+ buildx_cache_default : " ghcr.io/${{ github.repository }}/controller:buildx-cache-${{needs.github-release.outputs.default_branch_slug}}-${{matrix.arch}}"
10095 run : |+
10196 docker buildx build -t "$image" \
10297 --cache-to type=registry,ref="$buildx_cache",mode=max,compression=zstd,compression-level=13,force-compression=true \
10398 --cache-from type=registry,ref="$buildx_cache" \
99+ --cache-from type=registry,ref="$buildx_cache_default" \
104100 --output=type=image,compression=zstd,force-compression=true,compression-level=13,push=true \
105101 .
106102
107103 publish-multiarch-image :
108- runs-on : ubuntu-latest
104+ runs-on : [self-hosted, linux]
109105 name : publish-multiarch-image
110106 needs :
111107 - github-release
112- - build-container- image
108+ - build-image
113109 steps :
114- - name : Checkout
115- uses : actions/checkout@v4
116-
117110 - uses : nxtcoder17/actions/setup-docker@main
118111 with :
119112 docker_registry : " ghcr.io"
@@ -133,11 +126,11 @@ jobs:
133126 secrets : inherit
134127 needs :
135128 - github-release
136- - build-container- image
129+ - build-image
137130 with :
138131 chart_version : ${{ needs.github-release.outputs.version }}
139132 chart_app_version : ${{ needs.github-release.outputs.version }}
140- overwrite_release_assets : ${{ needs.github-release.outputs.is_nightly }}
133+ overwrite_release_assets : ${{ needs.github-release.outputs.is_pre_release }}
141134 charts : |+
142135 ./helm-chart
143136 github_release : " ${{ needs.github-release.outputs.version }}"
0 commit comments