Skip to content

ci: Upload static build artifacts #34

ci: Upload static build artifacts

ci: Upload static build artifacts #34

Workflow file for this run

name: Build Canto Core
# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed
on:
pull_request:
push:
branches:
- main
- release/**
- upgrade/**
# TODO: debugging
- feature/upload_build_artifact
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}-build
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-arch: ["amd64"]
go-os: ["linux"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.21"
- name: Non-static Build
env:
GOARCH: ${{ matrix.go-arch }}
GOOS: ${{ matrix.go-os }}
LEDGER_ENABLED: false
run: |
make build
mv ./build/cantod ./build/cantod-nonstatic-${{ matrix.go-os }}-${{ matrix.go-arch }}
- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Static Build
env:
CC: musl-gcc
GOARCH: ${{ matrix.go-arch }}
GOOS: ${{ matrix.go-os }}
LEDGER_ENABLED: false
LDFLAGS: "-extldflags -static"
run: |
make build
mv build/cantod ./build/cantod-${{ matrix.go-os }}-${{ matrix.go-arch }}
- name: Upload cantod Binary (Static)
uses: actions/upload-artifact@v4
with:
name: cantod-${{ matrix.go-os }}-${{ matrix.go-arch }}
path: ./build/cantod-${{ matrix.go-os }}-${{ matrix.go-arch }}