@@ -41,80 +41,83 @@ jobs:
4141 # speed this up we build single-platform packages in parallel. We then upload
4242 # those packages to GitHub as a build artifact. The push job downloads those
4343 # artifacts and pushes them as a single multi-platform package.
44- # build:
45- # runs-on: ubuntu-24.04
46- # strategy:
47- # fail-fast: true
48- # matrix:
49- # arch:
50- # - amd64
51- # - arm64
52- # steps:
53- # - name: Setup QEMU
54- # uses: docker/setup-qemu-action@v3
55- # with:
56- # platforms: all
57-
58- # - name: Setup Docker Buildx
59- # uses: docker/setup-buildx-action@v3
60- # with:
61- # version: ${{ env.DOCKER_BUILDX_VERSION }}
62- # install: true
63-
64- # - name: Checkout
65- # uses: actions/checkout@v6
66-
67- # # We ask Docker to use GitHub Action's native caching support to speed up
68- # # the build, per https://docs.docker.com/build/cache/backends/gha/.
69- # - name: Build Runtime
70- # id: image
71- # uses: docker/build-push-action@v6
72- # with:
73- # context: .
74- # platforms: linux/${{ matrix.arch }}
75- # cache-from: type=gha
76- # cache-to: type=gha,mode=max
77- # target: image
78- # build-args:
79- # PYTHON_VERSION=${{ env.PYTHON_VERSION }}
80- # outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar
44+ build :
45+ runs-on : ubuntu-24.04
46+ needs :
47+ - lint
48+ - unit-test
49+ strategy :
50+ fail-fast : true
51+ matrix :
52+ arch :
53+ - amd64
54+ - arm64
55+ steps :
56+ - name : Setup QEMU
57+ uses : docker/setup-qemu-action@v3
58+ with :
59+ platforms : all
60+
61+ - name : Setup Docker Buildx
62+ uses : docker/setup-buildx-action@v3
63+ with :
64+ version : ${{ env.DOCKER_BUILDX_VERSION }}
65+ install : true
66+
67+ - name : Checkout
68+ uses : actions/checkout@v6
69+
70+ # We ask Docker to use GitHub Action's native caching support to speed up
71+ # the build, per https://docs.docker.com/build/cache/backends/gha/.
72+ - name : Build Runtime
73+ id : image
74+ uses : docker/build-push-action@v6
75+ with :
76+ context : .
77+ platforms : linux/${{ matrix.arch }}
78+ cache-from : type=gha
79+ cache-to : type=gha,mode=max
80+ target : image
81+ build-args :
82+ PYTHON_VERSION=${{ env.PYTHON_VERSION }}
83+ outputs : type=docker,dest=runtime-${{ matrix.arch }}.tar
8184
82- # - name: Install Crossplane CLI
83- # run: curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
85+ - name : Install Crossplane CLI
86+ run : curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
8487
85- # - name: Print Crossplane client version
86- # run: ./crossplane version --client
88+ - name : Print Crossplane client version
89+ run : ./crossplane version --client
8790
88- # - name: Build Package
89- # run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
91+ - name : Build Package
92+ run : ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
9093
91- # - name: Upload Single-Platform Package
92- # uses: actions/upload-artifact@v6
93- # with:
94- # name: package-${{ matrix.arch }}
95- # path: "*.xpkg"
96- # if-no-files-found: error
97- # retention-days: 1
94+ - name : Upload Single-Platform Package
95+ uses : actions/upload-artifact@v6
96+ with :
97+ name : package-${{ matrix.arch }}
98+ path : " *.xpkg"
99+ if-no-files-found : error
100+ retention-days : 1
98101
99102
100103 # This job downloads the single-platform packages built by the build job, and
101104 # pushes them as a multi-platform package.
102105 push :
103106 if : ${{ github.event_name != 'pull_request' }}
104107 runs-on : ubuntu-24.04
105- # needs:
106- # - build
108+ needs :
109+ - build
107110 steps :
108111 - name : Checkout
109112 uses : actions/checkout@v6
110113
111- # - name: Download Single-Platform Packages
112- # uses: actions/download-artifact@v7
113- # with:
114- # # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
115- # pattern: "!*.dockerbuild"
116- # path: .
117- # merge-multiple: true
114+ - name : Download Single-Platform Packages
115+ uses : actions/download-artifact@v7
116+ with :
117+ # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
118+ pattern : " !*.dockerbuild"
119+ path : .
120+ merge-multiple : true
118121
119122 - name : Install Crossplane CLI
120123 run : curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
@@ -145,8 +148,8 @@ jobs:
145148 echo "ERROR: Git tag ($TAG_VERSION) does not match function/__version__.py ($PY_VERSION)"
146149 exit 1
147150 fi
148- echo "✅ Tag matches function/__version__.py"
149151 echo "XPKG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
152+ echo "✅ Tag matches function/__version__.py"
150153
151- # - name: Push Multi-Platform Package to GitHub Container Registry
152- # run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
154+ - name : Push Multi-Platform Package to GitHub Container Registry
155+ run : " ./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
0 commit comments