Skip to content

0.4.0-beta

0.4.0-beta #5

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: krknctl build
on:
release:
types: [published]
jobs:
build:
name: krknctl build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: set up go
uses: actions/setup-go@v4
with:
go-version: '1.23.1'
- name: install dependencies
run: |
sudo apt-get update && sudo apt-get install libbtrfs-dev
- name: advance version
run: |
cat <<< $(jq '.version="${{github.event.release.tag_name}}"' internal/config/config.json) > internal/config/config.json
- name: build linux amd64
env:
GOOS: "linux"
GOARCH: "amd64"
CGO_ENABLED: 0
BINARY: "linux-amd64"
GH_TOKEN: ${{ github.token }}
run: |
export FILENAME=krknctl-${{github.event.release.tag_name}}-$BINARY.tar.gz
go build -tags containers_image_openpgp -ldflags="-w -s" -o $BINARY/ ./...
tar cfvz $FILENAME -C $BINARY krknctl
gh release upload ${{github.event.release.tag_name}} $FILENAME
- name: build linux arm64
env:
GOOS: "linux"
GOARCH: "arm64"
CGO_ENABLED: 0
BINARY: "linux-arm64"
GH_TOKEN: ${{ github.token }}
run: |
export FILENAME=krknctl-${{github.event.release.tag_name}}-$BINARY.tar.gz
go build -tags containers_image_openpgp -ldflags="-w -s" -o $BINARY/ ./...
tar cfvz $FILENAME -C $BINARY krknctl
gh release upload ${{github.event.release.tag_name}} $FILENAME
- name: build darwin arm64
env:
GOOS: "darwin"
GOARCH: "arm64"
CGO_ENABLED: 0
BINARY: "darwin-apple-silicon"
GH_TOKEN: ${{ github.token }}
run: |
export FILENAME=krknctl-${{github.event.release.tag_name}}-$BINARY.tar.gz
go build -tags containers_image_openpgp -ldflags="-w -s" -o $BINARY/ ./...
tar cfvz $FILENAME -C $BINARY krknctl
gh release upload ${{github.event.release.tag_name}} $FILENAME
- name: build darwin amd64
env:
GOOS: "darwin"
GOARCH: "amd64"
CGO_ENABLED: 0
BINARY: "darwin-intel"
GH_TOKEN: ${{ github.token }}
run: |
export FILENAME=krknctl-${{github.event.release.tag_name}}-$BINARY.tar.gz
go build -tags containers_image_openpgp -ldflags="-w -s" -o $BINARY/ ./...
tar cfvz $FILENAME -C $BINARY krknctl
gh release upload ${{github.event.release.tag_name}} $FILENAME