From b080664f173f9f2bcd6739b87454cc8f92aae8d0 Mon Sep 17 00:00:00 2001 From: IPdotSetAF Date: Sat, 16 Nov 2024 02:38:54 +0330 Subject: [PATCH 1/6] added multiplatfrom binary support --- .github/workflows/build-release.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 845f625..cc7e81d 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -73,11 +73,17 @@ jobs: generate_release_notes: true files: | mssql-proxy-${{ github.ref_name }}-source.tar.gz - mssql-proxy-${{ github.ref_name }}-linux.tar.gz mssql-proxy-${{ github.ref_name }}-windows.zip + mssql-proxy-${{ github.ref_name }}-linux-amd64.tar.gz + mssql-proxy-${{ github.ref_name }}-linux-arm64.tar.gz build-linux: runs-on: ubuntu-latest + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm64 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -87,11 +93,14 @@ jobs: - run: ./Tools/mssql-proxy/odbc-driver-installer.sh - run: pyinstaller mssql-proxy.linux.spec working-directory: Tools/mssql-proxy - - run: tar -czf mssql-proxy-${{ github.ref_name }}-linux.tar.gz Tools/mssql-proxy/dist + - id: archive + run: | + echo "build_name=mssql-proxy-${{ github.ref_name }}-$(echo ${{ matrix.platform }} | sed 's:/:-:g').tar.gz\n" >> $GITHUB_OUTPUT + tar -czf $build_name Tools/mssql-proxy/dist - uses: actions/upload-artifact@v4 with: - name: build-linux - path: mssql-proxy-${{ github.ref_name }}-linux.tar.gz + name: build-${{ matrix.platform }} + path: ${{ steps.archive.outputs.build_name }} build-windows: runs-on: windows-latest From 9149de9ae969954a0fd6043a24d57809115ccb1a Mon Sep 17 00:00:00 2001 From: IPdotSetAF Date: Sat, 16 Nov 2024 02:39:14 +0330 Subject: [PATCH 2/6] added multiplatform docker builds --- .github/workflows/build-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index cc7e81d..978b5c0 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -51,6 +51,7 @@ jobs: push: true tags: ${{ needs.build-docker.outputs.tags }} labels: ${{ needs.build-docker.outputs.labels }} + platforms: linux/amd64, linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max @@ -145,5 +146,6 @@ jobs: push: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64, linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max From 1b5ce0b486f52ee5a74da78994bfb02da4510687 Mon Sep 17 00:00:00 2001 From: IPdotSetAF Date: Sat, 16 Nov 2024 03:20:29 +0330 Subject: [PATCH 3/6] build name fix --- .github/workflows/build-release.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 978b5c0..c6f4f45 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -94,14 +94,13 @@ jobs: - run: ./Tools/mssql-proxy/odbc-driver-installer.sh - run: pyinstaller mssql-proxy.linux.spec working-directory: Tools/mssql-proxy - - id: archive - run: | - echo "build_name=mssql-proxy-${{ github.ref_name }}-$(echo ${{ matrix.platform }} | sed 's:/:-:g').tar.gz\n" >> $GITHUB_OUTPUT - tar -czf $build_name Tools/mssql-proxy/dist + - id: name + run: echo "platform_name=$(echo ${{ matrix.platform }} | sed 's:/:-:g')" >> $GITHUB_OUTPUT + - run: tar -czf mssql-proxy-${{ github.ref_name }}-${{ steps.name.outputs.platform_name }}.tar.gz Tools/mssql-proxy/dist - uses: actions/upload-artifact@v4 with: - name: build-${{ matrix.platform }} - path: ${{ steps.archive.outputs.build_name }} + name: build-${{ steps.name.outputs.platform_name }} + path: mssql-proxy-${{ github.ref_name }}-${{ steps.name.outputs.platform_name }}.tar.gz build-windows: runs-on: windows-latest From 7a7f796d12d100a6a3e59c73e3eb991f2ac6ac7c Mon Sep 17 00:00:00 2001 From: IPdotSetAF Date: Sat, 16 Nov 2024 03:30:21 +0330 Subject: [PATCH 4/6] added prerelease release ci --- .github/workflows/build-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c6f4f45..a616bc8 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -71,6 +71,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 with: + prerelease: true generate_release_notes: true files: | mssql-proxy-${{ github.ref_name }}-source.tar.gz From 6fb0ae225b975e15910cd57d80fc0964fa2fcea9 Mon Sep 17 00:00:00 2001 From: IPdotSetAF Date: Sat, 16 Nov 2024 03:38:35 +0330 Subject: [PATCH 5/6] updated docker build workflow --- .github/workflows/build-release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index a616bc8..35674c0 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -33,6 +33,9 @@ jobs: - name: Install cosign uses: sigstore/cosign-installer@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -129,6 +132,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -138,7 +144,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image + - name: Build Docker images id: build-and-push uses: docker/build-push-action@v6 with: From 0ae67eab3becb4149e1be11e4d8eb4bca9c4528a Mon Sep 17 00:00:00 2001 From: IPdotSetAF Date: Sat, 16 Nov 2024 03:46:01 +0330 Subject: [PATCH 6/6] added aarch64 support to odbc-installer --- Tools/mssql-proxy/odbc-driver-installer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/mssql-proxy/odbc-driver-installer.sh b/Tools/mssql-proxy/odbc-driver-installer.sh index 63c61b6..46707bc 100755 --- a/Tools/mssql-proxy/odbc-driver-installer.sh +++ b/Tools/mssql-proxy/odbc-driver-installer.sh @@ -2,6 +2,7 @@ case $(uname -m) in x86_64) architecture="amd64" ;; arm64) architecture="arm64" ;; + aarch64) architecture="arm64" ;; *) architecture="unsupported" ;; esac if [[ "unsupported" == "$architecture" ]]; then