@@ -35,10 +35,10 @@ jobs:
3535 fetch-depth : 0
3636
3737 - name : Set up QEMU
38- uses : docker/setup-qemu-action@v2
38+ uses : docker/setup-qemu-action@v3
3939
4040 - name : Set up Docker Buildx
41- uses : docker/setup-buildx-action@v2
41+ uses : docker/setup-buildx-action@v3
4242
4343 - name : Login to DockerHub
4444 uses : docker/login-action@v2
5757
5858 - name : Build client for testing
5959 id : build_client
60- uses : docker/build-push-action@v4
60+ uses : docker/build-push-action@v6
6161 with :
6262 file : docker/Dockerfile
6363 push : false
7070
7171 - name : Build server for testing
7272 id : build_server
73- uses : docker/build-push-action@v4
73+ uses : docker/build-push-action@v6
7474 with :
7575 file : docker/Dockerfile
7676 push : false
@@ -101,8 +101,9 @@ jobs:
101101 # pushes the *same* docker images that were previously tested as part of e2e sanity test.
102102 # each image is pushed with the versioned tag first, if it succeeds the image is pushed with the latest tag as well.
103103 - name : Build & Push client
104- id : build_push_client
105- uses : docker/build-push-action@v4
104+ if : ${{ github.event.release.prerelease == false }}
105+ id : build_push_client_regular
106+ uses : docker/build-push-action@v6
106107 with :
107108 file : docker/Dockerfile
108109 platforms : linux/amd64,linux/arm64
@@ -114,9 +115,25 @@ jobs:
114115 permitio/opal-client:latest
115116 permitio/opal-client:${{ github.event.release.tag_name }}
116117
118+ - name : Build & Push client (prerelease)
119+ if : ${{ github.event.release.prerelease == true }}
120+ id : build_push_client_prerelease
121+ uses : docker/build-push-action@v6
122+ with :
123+ file : docker/Dockerfile
124+ platforms : linux/amd64,linux/arm64
125+ push : true
126+ target : client
127+ cache-from : type=registry,ref=permitio/opal-client:latest
128+ cache-to : type=inline
129+ tags : |
130+ permitio/opal-client:${{ github.event.release.tag_name }}
131+
132+
117133 - name : Build client-standalone
118- id : build_push_client_standalone
119- uses : docker/build-push-action@v4
134+ if : ${{ github.event.release.prerelease == false }}
135+ id : build_push_client_standalone_regular
136+ uses : docker/build-push-action@v6
120137 with :
121138 file : docker/Dockerfile
122139 platforms : linux/amd64,linux/arm64
@@ -128,9 +145,24 @@ jobs:
128145 permitio/opal-client-standalone:latest
129146 permitio/opal-client-standalone:${{ github.event.release.tag_name }}
130147
148+ - name : Build client-standalone (prerelease)
149+ if : ${{ github.event.release.prerelease == true }}
150+ id : build_push_client_standalone_prerelease
151+ uses : docker/build-push-action@v6
152+ with :
153+ file : docker/Dockerfile
154+ platforms : linux/amd64,linux/arm64
155+ push : true
156+ target : client-standalone
157+ cache-from : type=registry,ref=permitio/opal-client-standalone:latest
158+ cache-to : type=inline
159+ tags : |
160+ permitio/opal-client-standalone:${{ github.event.release.tag_name }}
161+
131162 - name : Build server
132- id : build_push_server
133- uses : docker/build-push-action@v4
163+ if : ${{ github.event.release.prerelease == false }}
164+ id : build_push_server_regular
165+ uses : docker/build-push-action@v6
134166 with :
135167 file : docker/Dockerfile
136168 platforms : linux/amd64,linux/arm64
@@ -142,9 +174,24 @@ jobs:
142174 permitio/opal-server:latest
143175 permitio/opal-server:${{ github.event.release.tag_name }}
144176
177+ - name : Build server (prerelease)
178+ if : ${{ github.event.release.prerelease == true }}
179+ id : build_push_server_prerelease
180+ uses : docker/build-push-action@v6
181+ with :
182+ file : docker/Dockerfile
183+ platforms : linux/amd64,linux/arm64
184+ push : true
185+ target : server
186+ cache-from : type=registry,ref=permitio/opal-server:latest
187+ cache-to : type=inline
188+ tags : |
189+ permitio/opal-server:${{ github.event.release.tag_name }}
190+
145191 - name : Build & Push client cedar
146- id : build_push_client_cedar
147- uses : docker/build-push-action@v4
192+ if : ${{ github.event.release.prerelease == false }}
193+ id : build_push_client_cedar_regular
194+ uses : docker/build-push-action@v6
148195 with :
149196 file : docker/Dockerfile
150197 platforms : linux/amd64,linux/arm64
@@ -156,6 +203,20 @@ jobs:
156203 permitio/opal-client-cedar:latest
157204 permitio/opal-client-cedar:${{ github.event.release.tag_name }}
158205
206+ - name : Build & Push client cedar (prerelease)
207+ if : ${{ github.event.release.prerelease == true }}
208+ id : build_push_client_cedar_prerelease
209+ uses : docker/build-push-action@v6
210+ with :
211+ file : docker/Dockerfile
212+ platforms : linux/amd64,linux/arm64
213+ push : true
214+ target : client-cedar
215+ cache-from : type=registry,ref=permitio/opal-client-cedar:latest
216+ cache-to : type=inline
217+ tags : |
218+ permitio/opal-client-cedar:${{ github.event.release.tag_name }}
219+
159220 - name : Python setup
160221 uses : actions/setup-python@v5
161222 with :
@@ -164,10 +225,22 @@ jobs:
164225 # This is the root file representing the package for all the sub-packages.
165226 - name : Bump version - packaging__.py
166227 run : |
228+ # Install required packages
229+ pip install semver packaging
230+
231+ # Get version tag and remove 'v' prefix
167232 version_tag=${{ github.event.release.tag_name }}
168- version_tag=${version_tag#v} # Remove the leading 'v'
169- version_tuple=$(echo $version_tag | sed 's/\./, /g')
170- sed -i "s/VERSION = (.*/VERSION = (${version_tuple})/" packages/__packaging__.py
233+ version_tag=${version_tag#v}
234+
235+ # Convert semver to PyPI version using the script
236+ pypi_version=$(python semver2pypi.py $version_tag)
237+
238+ # Update only the __version__ in __packaging__.py
239+ sed -i "s/__version__ = VERSION_STRING/__version__ = \"$pypi_version\"/" packages/__packaging__.py
240+
241+ # Print the result for verification
242+ echo "Original version tag: $version_tag"
243+ echo "PyPI version: $pypi_version"
171244 cat packages/__packaging__.py
172245
173246 - name : Cleanup setup.py and Build every sub-packages
0 commit comments