Skip to content

Cross-Compile Shared Libraries #1

Cross-Compile Shared Libraries

Cross-Compile Shared Libraries #1

name: Cross-Compile Shared Libraries
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
targets:
- linux/amd64
- linux/arm64
- windows/amd64
- windows/arm64
- darwin/amd64
- darwin/arm64
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cross-Compile with xgo
uses: crazy-max/[email protected]
with:
xgo_version: latest
go_version: 1.22.0
dest: dist
pkg: sharedlibrary
prefix: cosmium
targets: ${{ matrix.targets }}
v: true
buildmode: c-shared
- name: Package output as tar.gz
run: |
mkdir -p packaged
tar -czvf packaged/cosmium-shared-libraries.tar.gz -C dist .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: shared-libraries
path: packaged/cosmium-shared-libraries.tar.gz