Skip to content

Commit

Permalink
Add windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Jul 22, 2024
1 parent 62983c4 commit 7336e27
Showing 1 changed file with 72 additions and 7 deletions.
79 changes: 72 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,35 @@ jobs:
# reporter: java-junit
# fail-on-error: 'true'

build:
release:
runs-on: ubuntu-latest
# needs: [ tests-combine-summaries ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
with:
versionSpec: 5.x
- id: determine_version
name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.15
with:
additionalArguments: /overrideconfig mode=Mainline
- name: Tag Release
uses: mathieudutour/github-tag-action@v6.1
continue-on-error: true
with:
custom_tag: ${{ steps.determine_version.outputs.semVer }}
github_token: ${{ secrets.GITHUB_TOKEN }}

build-linux:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -238,16 +264,55 @@ jobs:
# GOOS: darwin
# GOARCH: arm64
# CGO_ENABLED: 1
- name: Tag Release
uses: mathieudutour/github-tag-action@v6.1
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
continue-on-error: true
with:
custom_tag: ${{ steps.determine_version.outputs.semVer }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.determine_version.outputs.semVer }}+run${{ github.run_number }}-attempt${{ github.run_attempt }}
files: |
octoterrawiz_linux_amd64
build-windows:
runs-on: windows-latest
needs: [ release ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.5'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.15
with:
versionSpec: 5.x
- id: determine_version
name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.15
with:
additionalArguments: /overrideconfig mode=Mainline
- name: Install Dependencies
run: go get ./...
shell: bash
- run: go build -ldflags="-X 'main.Version=${{ steps.determine_version.outputs.semVer }}'" -o octoterrawiz_linux_amd64 octoterrawiz.go
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 1
- run: go build -ldflags="-X 'main.Version=${{ steps.determine_version.outputs.semVer }}'" -o octoterrawiza_windows_amd64.exe octoterrawiz.go
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: 1
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
continue-on-error: true
with:
tag_name: ${{ steps.determine_version.outputs.semVer }}+run${{ github.run_number }}-attempt${{ github.run_attempt }}
files: |
octoterrawiz_linux_amd64
octoterrawiza_windows_amd64.exe

0 comments on commit 7336e27

Please sign in to comment.