Skip to content

Commit

Permalink
ci-cd: add release jobs for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
silverhairs committed Sep 5, 2023
1 parent 9d8d15c commit 1ebd02f
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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

0 comments on commit 1ebd02f

Please sign in to comment.