From 1ebd02fdfdda8ab747116e6ff813f426bbfa17cc Mon Sep 17 00:00:00 2001 From: Boris Kayi Date: Tue, 5 Sep 2023 15:44:40 +0200 Subject: [PATCH] ci-cd: add release jobs for windows --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fd9f40..622bba3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,6 +81,30 @@ jobs: name: glox-linux-${{ matrix.arch }} path: ./glox/glox-linux-${{ matrix.arch }} + build_windows_artifact: + runs-on: windows-latest + needs: [analyze_and_test] + strategy: + matrix: + os: [windows-latest] + arch: [amd64] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '^1.20.0' + check-latest: true + - run: go version + + - name: Build Binary for ${{ matrix.os }} / ${{ matrix.arch }} + run: | + go build -v -o glox-windows-${{ matrix.arch }}.exe + - name: Upload artifact for ${{ matrix.os }} / ${{ matrix.arch }} + uses: actions/upload-artifact@v2 + with: + name: glox-windows-${{ matrix.arch }} + path: ${{ runner.temp }}\glox\glox-windows-${{ matrix.arch }}.exe + publish_release: runs-on: ubuntu-latest needs: [build_macos_artifacts, build_linux_artifacts] @@ -151,3 +175,20 @@ jobs: asset_path: ${{ steps.download_linux_artifacts.outputs.download-path }}/glox-linux-amd64 asset_name: glox-linux-amd64 asset_content_type: application/octet-stream + + - name: Download windows artifact + id: download_windows_artifact + uses: actions/download-artifact@v2 + with: + name: glox-windows-amd64.exe + path: ../build/ + + - name: Upload windows release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ steps.download_windows_artifact.download-path }}/glox-windows-amd64.exe + asset_name: glox-windows-amd64 + asset_content_type: application/octet-stream