Skip to content

Commit

Permalink
Move windows build to separate job
Browse files Browse the repository at this point in the history
Don't block other linux steps on building the windows binary

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Feb 7, 2025
1 parent bc45972 commit 20a9a6b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/build-k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,14 @@ jobs:
build:
name: Build
runs-on: ${{ inputs.arch }} # defaults to ubuntu-latest, for arm64 use ubuntu-24.04-arm
timeout-minutes: 30
timeout-minutes: 20
steps:
- name: Checkout K3s
uses: actions/checkout@v4
- name: Build K3s binary
run: |
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 make
sha256sum dist/artifacts/k3s | sed 's|dist/artifacts/||' > dist/artifacts/k3s.sha256sum
- name: Build K3s binary (windows)
if: inputs.arch == 'ubuntu-latest'
run: |
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 GOOS=windows make
sha256sum dist/artifacts/k3s.exe | sed 's|dist/artifacts/||' > dist/artifacts/k3s.exe.sha256sum
- name: Build K3s image
if: inputs.upload-image == true
run: make package-image
Expand All @@ -50,3 +45,20 @@ jobs:
with:
name: k3s-arm64
path: dist/artifacts/k3s*
build-windows:
name: Build (windows)
if: inputs.arch == 'ubuntu-latest'
runs-on: ${{ inputs.arch }} # defaults to ubuntu-latest, for arm64 use ubuntu-24.04-arm
timeout-minutes: 20
steps:
- name: Checkout K3s
uses: actions/checkout@v4
- name: Build K3s binary
run: |
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 GOOS=windows make
sha256sum dist/artifacts/k3s.exe | sed 's|dist/artifacts/||' > dist/artifacts/k3s.exe.sha256sum
- name: "Upload K3s Artifacts"
uses: actions/upload-artifact@v4
with:
name: k3s-windows
path: dist/artifacts/k3s*
2 changes: 1 addition & 1 deletion .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
- name: "Download k3s binary"
uses: actions/download-artifact@v4
with:
name: k3s
name: k3s-windows
path: dist/artifacts/
- name: "Run K3s"
timeout-minutes: 5
Expand Down

0 comments on commit 20a9a6b

Please sign in to comment.