linuxc: create transient unit cgroup on systemd enabled distribution … #288
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [master] | |
tags: [v*] | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
name: Goreleaser | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- | |
name: Fetch all tags | |
run: git fetch --force --tags | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v3 | |
if: ${{ contains(github.ref, 'v') }} | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Test GoReleaser | |
uses: goreleaser/goreleaser-action@v3 | |
if: ${{ ! contains(github.ref, 'v') }} | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release --snapshot --clean | |
build: | |
name: Build-${{ matrix.os }}-${{ matrix.GOARCH }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
GOARCH: | |
- amd64 | |
include: | |
- os: ubuntu-latest | |
GOARCH: "386" | |
- os: ubuntu-latest | |
GOARCH: "arm" | |
- os: ubuntu-latest | |
GOARCH: "arm64" | |
- os: ubuntu-latest | |
GOARCH: "riscv64" | |
- os: macos-latest | |
GOARCH: "arm64" | |
steps: | |
- name: Set up Go 1.21 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Get git tag ref | |
run: git fetch --prune --unshallow --tags | |
- name: Restore Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Download dependencies | |
run: go mod download | |
- name: Generate version | |
run: go generate ./cmd/executorserver/version | |
- name: Build on Linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
env: | |
GOARCH: ${{ matrix.GOARCH }} | |
CGO_ENABLE: 0 | |
run: | | |
go build -v -tags nomsgpack -o executorserver ./cmd/executorserver | |
go build -v -o executorshell ./cmd/executorshell | |
go build -o cinit ./cmd/cinit | |
- name: Build shared objects on Linux | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.GOARCH == 'amd64' }} | |
env: | |
GOARCH: ${{ matrix.GOARCH }} | |
run: | | |
go build -buildmode=c-shared -o executorserver.so ./cmd/ffi | |
- name: Upload executorserver on linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorServer-${{ matrix.GOARCH }} | |
path: executorserver | |
- name: Upload executorshell on linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorShell-${{ matrix.GOARCH }} | |
path: executorshell | |
- name: Upload cinit on linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cinit-${{ matrix.GOARCH }} | |
path: cinit | |
- name: Upload executorserver.so on linux | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.GOARCH == 'amd64' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorServer-${{ matrix.GOARCH }}.so | |
path: executorserver.so | |
- name: Build on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
env: | |
GOARCH: ${{ matrix.GOARCH }} | |
run: | | |
go build -tags nomsgpack -o executorserver.exe ./cmd/executorserver | |
- name: Build shared object on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
env: | |
GOARCH: ${{ matrix.GOARCH }} | |
run: | | |
go build -buildmode=c-shared -o executorserver.dll ./cmd/ffi | |
- name: Upload executorserver.exe on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorServer-${{ matrix.GOARCH }}.exe | |
path: executorserver.exe | |
- name: Upload executorserver.dll on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorServer-${{ matrix.GOARCH }}.dll | |
path: executorserver.dll | |
- name: Build on macOS | |
if: ${{ matrix.os == 'macos-latest' }} | |
env: | |
GOARCH: ${{ matrix.GOARCH }} | |
run: | | |
go build -tags nomsgpack -o executorserver ./cmd/executorserver | |
go build -o executorshell ./cmd/executorshell | |
- name: Build shared object on macOS | |
if: ${{ matrix.os == 'macos-latest' && matrix.GOARCH == 'amd64' }} | |
env: | |
GOARCH: ${{ matrix.GOARCH }} | |
run: | | |
go build -buildmode=c-shared -o executorserver.dylib ./cmd/ffi | |
- name: Upload executorserver on macOS | |
if: ${{ matrix.os == 'macos-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorServer-MacOS-${{ matrix.GOARCH }} | |
path: executorserver | |
- name: Upload executorshell on macOS | |
if: ${{ matrix.os == 'macos-latest' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorShell-MacOS-${{ matrix.GOARCH }} | |
path: executorshell | |
- name: Upload executorserver.dylib on macOS | |
if: ${{ matrix.os == 'macos-latest' && matrix.GOARCH == 'amd64' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ExecutorServer-${{ matrix.GOARCH }}.dylib | |
path: executorserver.dylib |