@@ -14,10 +14,10 @@ jobs:
14
14
with :
15
15
fetch-depth : 0
16
16
submodules : true
17
- - name : Set up Python 3.8
17
+ - name : Set up Python 3.10
18
18
uses : actions/setup-python@v4
19
19
with :
20
- python-version : 3.8
20
+ python-version : 3.10
21
21
- name : Install dependencies
22
22
run : |
23
23
python -m pip install --upgrade pip
@@ -47,22 +47,43 @@ jobs:
47
47
run : |
48
48
poetry version ${{ steps.tag.outputs.result }}
49
49
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
51
60
- name : Set up Docker Buildx
52
- uses : docker/setup-buildx-action@v1
61
+ uses : docker/setup-buildx-action@v2
53
62
- name : Login to DockerHub
54
- uses : docker/login-action@v1
63
+ uses : docker/login-action@v2
55
64
with :
56
65
username : ${{ secrets.DOCKERHUB_USERNAME }}
57
66
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
58
78
- name : Build and push docker image
59
79
id : docker_build
60
- uses : docker/build-push-action@v2
80
+ uses : docker/build-push-action@v3
61
81
with :
82
+ platforms : linux/amd64,linux/arm64
62
83
push : true
63
84
context : .
64
85
file : resources/Dockerfile
65
- tags : cloudblueconnect/connect-cli: ${{ steps.tag .outputs.result }},cloudblueconnect/connect-cli:latest
86
+ tags : ${{ steps.meta .outputs.tags }}
66
87
- name : Docker image digest
67
88
run : echo ${{ steps.docker_build.outputs.digest }}
68
89
windows :
@@ -73,10 +94,10 @@ jobs:
73
94
with :
74
95
fetch-depth : 0
75
96
submodules : true
76
- - name : Set up Python 3.8
97
+ - name : Set up Python 3.10
77
98
uses : actions/setup-python@v4
78
99
with :
79
- python-version : 3.8
100
+ python-version : 3.10
80
101
- name : Install dependencies
81
102
run : |
82
103
python -m pip install --upgrade pip
0 commit comments