mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-24 11:03:31 +00:00
* simplify sharding in package tests for CI; increase to 12 shards Signed-off-by: Avi Deitcher <avi@deitcher.net> * for CI setup-go action, determine it based on go.mod file Signed-off-by: Avi Deitcher <avi@deitcher.net> --------- Signed-off-by: Avi Deitcher <avi@deitcher.net>
98 lines
2.4 KiB
YAML
98 lines
2.4 KiB
YAML
name: Release Tagged Linuxkit
|
|
|
|
on:
|
|
create:
|
|
|
|
jobs:
|
|
build-all:
|
|
name: Build all targets expect macOS
|
|
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
- name: Set up Go based on go.mod
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'src/cmd/linuxkit/go.mod'
|
|
id: go
|
|
|
|
|
|
- name: Set path
|
|
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
|
env:
|
|
GOPATH: ${{runner.workspace}}
|
|
|
|
- name: Build
|
|
run: |
|
|
make build-targets-linux build-targets-windows
|
|
env:
|
|
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: Check out code
|
|
uses: actions/checkout@v4
|
|
- name: Set up Go based on go.mod
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'src/cmd/linuxkit/go.mod'
|
|
id: go
|
|
|
|
|
|
- name: Set path
|
|
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
|
env:
|
|
GOPATH: ${{runner.workspace}}
|
|
|
|
- name: Build
|
|
run: |
|
|
make build-targets-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
|
|
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
draft: true
|
|
files: bin/*
|
|
generate_release_notes: true
|