55 branches :
66 - main
77 - release-*
8- tags :
9- - ' v*' # Only tags like v0.1.0 trigger the push job
108 pull_request : {}
9+ workflow_dispatch : {}
1110
1211env :
1312 PYTHON_VERSION : " 3.11"
@@ -22,29 +21,23 @@ jobs:
2221 runs-on : ubuntu-24.04
2322 steps :
2423 - uses : actions/checkout@v6
25-
2624 - uses : actions/setup-python@v6
2725 with :
2826 python-version : ${{ env.PYTHON_VERSION }}
29-
3027 - name : Install Hatch
3128 run : pipx install hatch==${{ env.HATCH_VERSION }}
32-
3329 - name : Lint
3430 run : hatch fmt
3531
3632 unit-test :
3733 runs-on : ubuntu-24.04
3834 steps :
3935 - uses : actions/checkout@v6
40-
4136 - uses : actions/setup-python@v6
4237 with :
4338 python-version : ${{ env.PYTHON_VERSION }}
44-
4539 - name : Install Hatch
4640 run : pipx install hatch==${{ env.HATCH_VERSION }}
47-
4841 - name : Run unit tests
4942 run : hatch test --all --randomize
5043
5952 arch :
6053 - amd64
6154 - arm64
62-
6355 steps :
64- - name : Setup QEMU
65- uses : docker/setup-qemu-action@v3
66- with :
67- platforms : all
68-
69- - name : Setup Docker Buildx
70- uses : docker/setup-buildx-action@v3
71- with :
72- version : ${{ env.DOCKER_BUILDX_VERSION }}
73- install : true
74-
7556 - uses : actions/checkout@v6
76-
7757 - uses : actions/setup-python@v6
7858 with :
7959 python-version : ${{ env.PYTHON_VERSION }}
@@ -90,14 +70,12 @@ jobs:
9070 target : image
9171 cache-from : type=gha
9272 cache-to : type=gha,mode=max
93- build-args :
94- PYTHON_VERSION=${{ env.PYTHON_VERSION }}
73+ build-args : " PYTHON_VERSION=${{ env.PYTHON_VERSION }}"
9574 outputs : type=docker,dest=runtime-${{ matrix.arch }}.tar
9675
9776 - name : Install Crossplane CLI
9877 run : curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
9978
100-
10179 - name : Print Crossplane version
10280 run : ./crossplane version
10381
@@ -108,18 +86,20 @@ jobs:
10886 --package-file=${{ matrix.arch }}.xpkg \
10987 --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
11088
111- - name : Upload package artifact
89+ - name : Upload combined artifact
11290 uses : actions/upload-artifact@v6
11391 with :
114- name : package-${{ matrix.arch }}
115- path : " *.xpkg"
92+ name : artifact-${{ matrix.arch }}
93+ path : |
94+ runtime-${{ matrix.arch }}.tar
95+ *.xpkg
11696 retention-days : 1
11797
11898 push :
11999 runs-on : ubuntu-24.04
120100 needs :
121101 - build
122- if : startsWith(github.ref, 'refs/tags/v') # Only run on tags
102+ if : startsWith(github.ref, 'refs/tags/v')
123103 steps :
124104 - uses : actions/checkout@v6
125105
@@ -132,7 +112,6 @@ jobs:
132112 - name : Install Crossplane CLI
133113 run : curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
134114
135-
136115 - name : Print Crossplane version
137116 run : ./crossplane version
138117
@@ -145,7 +124,7 @@ jobs:
145124
146125 - name : Check tag matches package version
147126 run : |
148- TAG_VERSION=${GITHUB_REF#refs/tags/} # Remove refs/tags/
127+ TAG_VERSION=${GITHUB_REF#refs/tags/}
149128 echo "Git tag: $TAG_VERSION"
150129 if [ "$TAG_VERSION" != "v$PY_VERSION" ]; then
151130 echo "ERROR: Git tag ($TAG_VERSION) does not match function/__version__.py ($PY_VERSION)"
0 commit comments