mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
separate release builds of macOS CGO from others
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
parent
bfac135e4e
commit
7acc8262f2
63
.github/workflows/release.yml
vendored
63
.github/workflows/release.yml
vendored
@ -4,8 +4,8 @@ on:
|
|||||||
create:
|
create:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-all:
|
||||||
name: Build all targets
|
name: Build all targets expect macOS
|
||||||
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
|
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -26,10 +26,67 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
make build-all-targets
|
make build-targets-all
|
||||||
env:
|
env:
|
||||||
GOPATH: ${{runner.workspace}}
|
GOPATH: ${{runner.workspace}}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-targets-except-cgo
|
||||||
|
path: bin/
|
||||||
|
|
||||||
|
# separate macos build because macos needs CGO, and it is very hard to cross-compile that
|
||||||
|
build-macos:
|
||||||
|
name: Build macOS target
|
||||||
|
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set up Go 1.122
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.22.3
|
||||||
|
id: go
|
||||||
|
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set path
|
||||||
|
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
|
env:
|
||||||
|
GOPATH: ${{runner.workspace}}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
make build-target-macos
|
||||||
|
env:
|
||||||
|
GOPATH: ${{runner.workspace}}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-targets-macos
|
||||||
|
path: bin/
|
||||||
|
|
||||||
|
release-artifacts:
|
||||||
|
needs: [build-all, build-macos]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-targets-except-cgo
|
||||||
|
path: bintmp/release-targets-except-cgo
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-targets-macos
|
||||||
|
path: bintmp/release-targets-macos
|
||||||
|
- name: Combine Artifacts
|
||||||
|
run: |
|
||||||
|
mkdir -p bin/
|
||||||
|
cp bintmp/*/* bin/
|
||||||
|
- name: Checksum Artifacts
|
||||||
|
run: |
|
||||||
|
make checksum-targets
|
||||||
- name: GitHub Release
|
- name: GitHub Release
|
||||||
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
||||||
env:
|
env:
|
||||||
|
12
Makefile
12
Makefile
@ -119,10 +119,8 @@ endif
|
|||||||
./scripts/update-component-sha.sh --image $${img}$(image); \
|
./scripts/update-component-sha.sh --image $${img}$(image); \
|
||||||
done
|
done
|
||||||
|
|
||||||
.PHONY: build-all-targets
|
.PHONY: build-targets-all
|
||||||
build-all-targets: bin
|
build-targets-all: bin
|
||||||
$(MAKE) GOOS=darwin GOARCH=arm64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-darwin-arm64 local-build
|
|
||||||
file bin/linuxkit-darwin-arm64
|
|
||||||
$(MAKE) GOOS=darwin GOARCH=amd64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-darwin-amd64 local-build
|
$(MAKE) GOOS=darwin GOARCH=amd64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-darwin-amd64 local-build
|
||||||
file bin/linuxkit-darwin-amd64
|
file bin/linuxkit-darwin-amd64
|
||||||
$(MAKE) GOOS=linux GOARCH=arm64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-linux-arm64 local-build
|
$(MAKE) GOOS=linux GOARCH=arm64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-linux-arm64 local-build
|
||||||
@ -133,4 +131,10 @@ build-all-targets: bin
|
|||||||
file bin/linuxkit-linux-s390x
|
file bin/linuxkit-linux-s390x
|
||||||
$(MAKE) GOOS=windows GOARCH=amd64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-windows-amd64.exe local-build
|
$(MAKE) GOOS=windows GOARCH=amd64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-windows-amd64.exe local-build
|
||||||
file bin/linuxkit-windows-amd64.exe
|
file bin/linuxkit-windows-amd64.exe
|
||||||
|
|
||||||
|
build-target-macos: bin
|
||||||
|
$(MAKE) GOOS=darwin GOARCH=arm64 LOCAL_TARGET=$(CURDIR)/bin/linuxkit-darwin-arm64 local-build
|
||||||
|
file bin/linuxkit-darwin-arm64
|
||||||
|
|
||||||
|
checksum-targets: bin
|
||||||
cd bin && openssl sha256 -r linuxkit-* | tr -d '*' > checksums.txt
|
cd bin && openssl sha256 -r linuxkit-* | tr -d '*' > checksums.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user