@@ -12,59 +12,32 @@ permissions:
1212 id-token : write
1313 packages : write
1414
15- env :
16- REGISTRY : ghcr.io
17- IMAGE_NAME : ${{ github.repository }}
18-
1915jobs :
2016 publish :
2117 uses : ./.github/workflows/publish.yml
2218 if : github.ref_type == 'tag'
2319
20+ build-linux :
21+ uses : ./.github/workflows/build-linux.yml
22+
23+ build-windows :
24+ uses : ./.github/workflows/build-windows.yml
25+
26+ build-macos :
27+ uses : ./.github/workflows/build-macos.yml
28+
29+ build-publish-docker :
30+ uses : ./.github/workflows/build-publish-docker.yml
31+ needs : [publish, build-linux, build-windows, build-macos]
32+
2433 release :
2534 runs-on : ubuntu-latest
2635 if : github.ref_type == 'tag'
27- needs : [publish, build-linux, build-windows, build -docker]
36+ needs : [build-publish -docker]
2837 steps :
2938 - name : Checkout
3039 uses : actions/checkout@v4
3140
32- # publish docker
33- - name : Install cosign
34- uses : sigstore/cosign-installer@v3
35-
36- - name : Set up QEMU
37- uses : docker/setup-qemu-action@v3
38-
39- - name : Set up Docker Buildx
40- uses : docker/setup-buildx-action@v3
41-
42- - name : Log into registry ${{ env.REGISTRY }}
43- uses : docker/login-action@v3
44- with :
45- registry : ${{ env.REGISTRY }}
46- username : ${{ github.actor }}
47- password : ${{ secrets.GITHUB_TOKEN }}
48-
49- - name : Build and push Docker image
50- id : build-and-push
51- uses : docker/build-push-action@v6
52- with :
53- context : .
54- push : true
55- tags : ${{ needs.build-docker.outputs.tags }}
56- labels : ${{ needs.build-docker.outputs.labels }}
57- platforms : linux/amd64, linux/arm64
58- cache-from : type=gha
59- cache-to : type=gha,mode=max
60-
61- - name : Sign the published Docker image
62- env :
63- TAGS : ${{ needs.build-docker.outputs.tags }}
64- DIGEST : ${{ steps.build-and-push.outputs.digest }}
65- run : echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
66-
67- # create release
6841 - run : tar -czf mssql-proxy-${{ github.ref_name }}-source.tar.gz Tools/mssql-proxy
6942 - uses : actions/download-artifact@v4
7043 with :
8154 mssql-proxy-${{ github.ref_name }}-windows.zip
8255 mssql-proxy-${{ github.ref_name }}-linux-amd64.tar.gz
8356 mssql-proxy-${{ github.ref_name }}-linux-arm64.tar.gz
84-
85- build-linux :
86- runs-on : ubuntu-latest
87- strategy :
88- matrix :
89- platform :
90- - linux/amd64
91- - linux/arm64
92- steps :
93- - uses : actions/checkout@v4
94- - uses : actions/setup-python@v5
95- with :
96- python-version : 3.11.4
97- - run : pip install -r Tools/mssql-proxy/requirements.txt pyinstaller
98- - run : ./Tools/mssql-proxy/odbc-driver-installer.sh
99- - run : pyinstaller mssql-proxy.linux.spec
100- working-directory : Tools/mssql-proxy
101- - id : name
102- run : echo "platform_name=$(echo ${{ matrix.platform }} | sed 's:/:-:g')" >> $GITHUB_OUTPUT
103- - run : tar -czf mssql-proxy-${{ github.ref_name }}-${{ steps.name.outputs.platform_name }}.tar.gz Tools/mssql-proxy/dist
104- - uses : actions/upload-artifact@v4
105- with :
106- name : build-${{ steps.name.outputs.platform_name }}
107- path : mssql-proxy-${{ github.ref_name }}-${{ steps.name.outputs.platform_name }}.tar.gz
108-
109- build-windows :
110- runs-on : windows-latest
111- steps :
112- - uses : actions/checkout@v4
113- - uses : actions/setup-python@v5
114- with :
115- python-version : 3.11.4
116- - run : pip install -r Tools/mssql-proxy/requirements.txt pyinstaller
117- - run : pyinstaller mssql-proxy.win.spec
118- working-directory : Tools/mssql-proxy
119- - run : tar -a -c -f mssql-proxy-${{ github.ref_name }}-windows.zip Tools/mssql-proxy/dist
120- - uses : actions/upload-artifact@v4
121- with :
122- name : build-windows
123- path : mssql-proxy-${{ github.ref_name }}-windows.zip
124-
125- # build-macos:
126-
127- build-docker :
128- runs-on : ubuntu-latest
129- outputs :
130- tags : ${{ steps.meta.outputs.tags }}
131- labels : ${{ steps.meta.outputs.labels }}
132- steps :
133- - uses : actions/checkout@v4
134-
135- - name : Set up QEMU
136- uses : docker/setup-qemu-action@v3
137-
138- - name : Set up Docker Buildx
139- uses : docker/setup-buildx-action@v3
140-
141- - name : Extract Docker metadata
142- uses : docker/metadata-action@v5
143- id : meta
144- with :
145- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
146-
147- - name : Build Docker images
148- id : build-and-push
149- uses : docker/build-push-action@v6
150- with :
151- context : .
152- push : false
153- tags : ${{ steps.meta.outputs.tags }}
154- labels : ${{ steps.meta.outputs.labels }}
155- platforms : linux/amd64, linux/arm64
156- cache-from : type=gha
157- cache-to : type=gha,mode=max
57+ mssql-proxy-${{ github.ref_name }}-macos.tar.gz
0 commit comments