Skip to content

github actions

github actions #9

Workflow file for this run

name: xtracfg
on: [push]
jobs:
build:
strategy:
matrix:
os:
- runner: ubuntu-latest
type: linux
#- runner: buildjet-2vcpu-ubuntu-2204-arm
# type: linux
- runner: macos-latest
type: macos
runs-on: ${{ matrix.os.runner }}
defaults:
run:
working-directory: ./xtracfg
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21.13"
cache-dependency-path: xtracfg/go.sum
- uses: graalvm/setup-graalvm@v1
with:
java-version: "17"
distribution: "liberica"
native-image-job-reports: true
cache: gradle
cache-dependency-path: |
xtracfg/*.gradle*
xtracfg/**/gradle-wrapper.properties
- name: build go
env:
CI_COMMIT_BRANCH: ${{ github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_COMMIT_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
JAVA_INCLUDE: ${{ matrix.os.type == 'macos' && 'darwin' || 'linux' }}
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
CGO_CFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/${JAVA_INCLUDE}" go build -x -buildmode c-archive -o dist/libxtracfg.a -ldflags="-s -w '-extldflags=-z noexecstack' -X github.com/interactive-instruments/xtraplatform-cli/xtracfg/cmd.gitTag=${CI_COMMIT_TAG} -X github.com/interactive-instruments/xtraplatform-cli/xtracfg/cmd.gitSha=${CI_COMMIT_SHA} -X github.com/interactive-instruments/xtraplatform-cli/xtracfg/cmd.gitBranch=${CI_COMMIT_BRANCH}"
- name: log1
run: |
ls -lR ./dist
- name: build java
run: |
./gradlew nativeCompile ${{ matrix.os.type == 'linux' && '-PSTATIC=true' || '' }}
- name: log2
run: |
ls -lR ./build/native/nativeCompile