Skip to content

Commit

Permalink
feat: create platform distros in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbonnet committed May 29, 2024
1 parent f5e03ef commit 94a7504
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,29 @@ jobs:
# files: |
# test-reports/*-tests-report.xml

- name: Build executables for other platforms
id: build-other-platforms
run: nix-shell --command "make build-other-platforms"
dist:
needs: [build]
name: Build executables for other platforms
strategy:
matrix:
os: [windows, linux]
arch: [amd64, 386]
include:
- os: darwin
arch: amd64
runs-on: ubuntu-latest
steps:
- name: Build executable for ${{matrix.os}} on ${{matrix.arch}}
run: nix-shell --command "make dist"
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}

release:
#if: github.ref == 'refs/heads/main' && success()
if: success()
uses: ./.github/workflows/release.yaml
needs: [build]
needs: [dist]
name: Release
with:
dry-run: false
Expand Down
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ test:

.PHONY: build
build: check test
@echo "build"
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(buildDir)/bin/production-readiness -v github.com/coreeng/production-readiness/production-readiness/cmd

.PHONY: build-other-platforms
build-other-platforms:
@echo "build for other platforms"
GOOS=windows GOARCH=amd64 go build -o $(buildDir)/bin/production-readiness-amd64.exe -v github.com/coreeng/production-readiness/production-readiness/cmd
GOOS=windows GOARCH=386 go build -o $(buildDir)/bin/production-readiness-386.exe -v github.com/coreeng/production-readiness/production-readiness/cmd
GOOS=darwin GOARCH=amd64 go build -o $(buildDir)/bin/production-readiness-amd64-darwin -v github.com/coreeng/production-readiness/production-readiness/cmd
GOOS=linux GOARCH=amd64 go build -o $(buildDir)/bin/production-readiness-amd64-linux -v github.com/coreeng/production-readiness/production-readiness/cmd
GOOS=linux GOARCH=386 go build -o $(buildDir)/bin/production-readiness-386-linux -v github.com/coreeng/production-readiness/production-readiness/cmd
@echo "== build"
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(buildDir)/bin/production-readiness -v github.com/coreeng/production-readiness/production-readiness/cmd

.PHONY: dist
dist:
@echo "== build distribution for platform $(GOOS) on $(GOARCH)"
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(buildDir)/bin/production-readiness-$(GOARCH).$(GOOS) -v github.com/coreeng/production-readiness/production-readiness/cmd

.PHONY: install
install: build
Expand Down

0 comments on commit 94a7504

Please sign in to comment.