@@ -14,10 +14,10 @@ jobs:
1414 with :
1515 fetch-depth : 0
1616 submodules : true
17- - name : Set up Python 3.8
17+ - name : Set up Python 3.10
1818 uses : actions/setup-python@v4
1919 with :
20- python-version : 3.8
20+ python-version : 3.10
2121 - name : Install dependencies
2222 run : |
2323 python -m pip install --upgrade pip
@@ -47,22 +47,43 @@ jobs:
4747 run : |
4848 poetry version ${{ steps.tag.outputs.result }}
4949 poetry build
50- poetry publish -u $TWINE_USERNAME -p $TWINE_PASSWORD
50+ if [ "$(curl -s -o /dev/null -w '%{http_code}' https://pypi.org/pypi/connect-cli/${{ steps.tag.outputs.result }}/json)" = "404" ]; then poetry publish -u $TWINE_USERNAME -p $TWINE_PASSWORD; fi
51+ - name : Set Connect and Runner major versions
52+ id : cnctver
53+ run : |
54+ echo connect_major="$(curl -sI https://api.connect.cloudblue.com/public/v1|grep -Fi 'connect-version' | tr -d '\r' | sed -En 's/^Connect-Version: (.*)/\1/p'|cut -f1 -d'.')" >> $GITHUB_OUTPUT
55+ echo runner_major="$(echo ${{ steps.tag.outputs.result }}|cut -f1 -d '.')" >> $GITHUB_OUTPUT
56+ - name : Set up QEMU
57+ uses : docker/setup-qemu-action@v2
58+ with :
59+ platforms : amd64,arm64
5160 - name : Set up Docker Buildx
52- uses : docker/setup-buildx-action@v1
61+ uses : docker/setup-buildx-action@v2
5362 - name : Login to DockerHub
54- uses : docker/login-action@v1
63+ uses : docker/login-action@v2
5564 with :
5665 username : ${{ secrets.DOCKERHUB_USERNAME }}
5766 password : ${{ secrets.DOCKERHUB_TOKEN }}
67+ - name : Docker meta
68+ id : meta
69+ uses : docker/metadata-action@v4
70+ with :
71+ images : cloudblueconnect/connect-cli
72+ tags : |
73+ type=semver,pattern={{major}}.{{minor}},value=${{ steps.tag.outputs.result }}.0
74+ type=semver,pattern={{major}},value=${{ steps.tag.outputs.result }}.0
75+ type=raw,value=latest,enable=${{ steps.cnctver.outputs.connect_major == steps.cnctver.outputs.runner_major }}
76+ flavor : |
77+ latest=false
5878 - name : Build and push docker image
5979 id : docker_build
60- uses : docker/build-push-action@v2
80+ uses : docker/build-push-action@v3
6181 with :
82+ platforms : linux/amd64,linux/arm64
6283 push : true
6384 context : .
6485 file : resources/Dockerfile
65- tags : cloudblueconnect/connect-cli: ${{ steps.tag .outputs.result }},cloudblueconnect/connect-cli:latest
86+ tags : ${{ steps.meta .outputs.tags }}
6687 - name : Docker image digest
6788 run : echo ${{ steps.docker_build.outputs.digest }}
6889 windows :
@@ -73,10 +94,10 @@ jobs:
7394 with :
7495 fetch-depth : 0
7596 submodules : true
76- - name : Set up Python 3.8
97+ - name : Set up Python 3.10
7798 uses : actions/setup-python@v4
7899 with :
79- python-version : 3.8
100+ python-version : 3.10
80101 - name : Install dependencies
81102 run : |
82103 python -m pip install --upgrade pip
0 commit comments