1111 description : ' Go version to use if building needs to be done'
1212 default : ' 1.25'
1313 required : false
14+ docker-buildx-version :
15+ description : ' Docker Buildx version to use'
16+ default : ' v0.28.0'
17+ required : false
18+
19+ env :
20+ VERSION : ${{ github.event.inputs.version }}
21+ GO_VERSION : ${{ github.event.inputs.go-version }}
22+ DOCKER_BUILDX_VERSION : ${{ github.event.inputs.docker-buildx-version }}
1423
1524jobs :
1625 publish-provider-package :
17- uses : crossplane-contrib/provider-workflows/.github/workflows/publish-provider.yml@main
18- with :
19- repository : provider-cloudscale
20- registry_org : onzack
21- version : ${{ github.event.inputs.version }}
22- go-version : ${{ github.event.inputs.go-version }}
23- cleanup-disk : false
24- secrets :
25- GHCR_PAT : ${{ secrets.GITHUB_TOKEN }}
26- # XPKG_MIRROR_TOKEN: ${{ secrets.XPKG_MIRROR_TOKEN }}
27- # XPKG_MIRROR_ACCESS_ID: ${{ secrets.XPKG_MIRROR_ACCESS_ID }}
26+ runs-on : ubuntu-24.04
27+ environment : publish
28+
29+ steps :
30+ - name : Setup QEMU
31+ uses : docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
32+ with :
33+ platforms : all
34+
35+ - name : Setup Docker Buildx
36+ uses : docker/setup-buildx-action@v3
37+ with :
38+ version : ${{ env.DOCKER_BUILDX_VERSION }}
39+ install : true
40+
41+ - name : Install Upbound CLI
42+ run : |
43+ curl -sL "https://cli.upbound.io" | sh
44+ sudo mv up /usr/local/bin/
45+ up --version
46+
47+ - name : Checkout
48+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
49+ with :
50+ submodules : true
51+
52+ - name : Fetch History
53+ run : git fetch --prune --unshallow
54+
55+ - name : Setup Go
56+ uses : actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
57+ with :
58+ go-version : ${{ env.GO_VERSION }}
59+
60+ - name : Find the Go Build Cache
61+ id : go
62+ run : echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT
63+
64+ - name : Cache the Go Build Cache
65+ uses : actions/cache@v4
66+ with :
67+ path : ${{ steps.go.outputs.cache }}
68+ key : ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }}
69+ restore-keys : ${{ runner.os }}-build-publish-artifacts-
70+
71+ - name : Cache Go Dependencies
72+ uses : actions/cache@v4
73+ with :
74+ path : .work/pkg
75+ key : ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
76+ restore-keys : ${{ runner.os }}-pkg-
77+
78+ - name : Vendor Dependencies
79+ run : make vendor vendor.check
80+
81+ - name : Build Artifacts
82+ run : make -j2 build.all
83+ env :
84+ # We're using docker buildx, which doesn't actually load the images it
85+ # builds by default. Specifying --load does so.
86+ BUILD_ARGS : " --load"
87+
88+ - name : Publish Artifacts
89+ env :
90+ UPBOUND_ROBOT_ACCOUNT_ID : ${{ secrets.UPBOUND_ROBOT_ACCOUNT_ID }}
91+ UPBOUND_ROBOT_ACCOUNT_TOKEN : ${{ secrets.UPBOUND_ROBOT_ACCOUNT_TOKEN }}
92+ run : |
93+ up login --token ${{ secrets.UPBOUND_ROBOT_ACCOUNT_TOKEN }} --account-id ${{ secrets.UPBOUND_ROBOT_ACCOUNT_ID }}
94+ up xpkg push -f _output/xpkg/linux_amd64/provider-cloudscale-${{ env.VERSION }}.xpkg xpkg.upbound.io/onzack-ag/provider-cloudscale:${{ env.VERSION }}
95+ up xpkg push -f _output/xpkg/linux_arm64/provider-cloudscale-${{ env.VERSION }}.xpkg xpkg.upbound.io/onzack-ag/provider-cloudscale:${{ env.VERSION }}
0 commit comments