Skip to content

Commit

Permalink
Enable multi os build and upload several artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
nhh committed Sep 22, 2024
1 parent fc163f4 commit fb88979
Showing 1 changed file with 53 additions and 5 deletions.
58 changes: 53 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,71 @@ on:

jobs:

build:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build -o k8x .
run: go build -o k8x-linux-x86_64 .
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
path: ./k8x
retention_days: 7
name: k8x-linux-x86_64
path: ./k8x-linux-x86_64

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build -o k8x-darwin-x86_64 .
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
retention_days: 7
name: k8x-darwin-x86_64
path: ./k8x-darwin-x86_64
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
run: go build -o k8x-windows-x86_64.exe .
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
retention_days: 7
name: k8x-windows-x86_64.exe
path: ./k8x-windows-x86_64.exe

release:
needs:
- build-windows
- build-linux
- build-macos
runs-on: ubuntu-latest
steps:
# Downloads all artifacts:
- name: Download a single artifact
uses: actions/download-artifact@v4
- name: Create github release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: k8x
files: |
k8x-windows-x86_64.exe.zip
k8x-linux-x86_64.zip
k8x-darwin-x86_64.zip

0 comments on commit fb88979

Please sign in to comment.