From 9f94e43ebc35b5edd0133b87a754f6c515852e7c Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Tue, 10 Oct 2023 01:31:32 -0700 Subject: [PATCH] github workflow --- .github/workflows/go-dev.yml | 33 +++++++++++++++++++++++++++++++++ README.md | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/go-dev.yml diff --git a/.github/workflows/go-dev.yml b/.github/workflows/go-dev.yml new file mode 100644 index 0000000..a5356da --- /dev/null +++ b/.github/workflows/go-dev.yml @@ -0,0 +1,33 @@ +# 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: Go Dev Build + +on: + push: + branches: ["develop"] + pull_request: + branches: ["develop"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: BuildWin64 + uses: addnab/docker-run-action@v3 + with: + image: x1unix/go-mingw:1.20 + options: -v ${{ github.workspace }}:/go/work -w /go/work -e GOARCH=amd64 -e CGO_ENABLED=1 + + run: | + go build -o ./ifxmetrics_x64.dll -buildmode=c-shared -buildvcs=false -ldflags "-w -s -X main.EXTENSION_VERSION=${{github.ref_name}}-${{github.sha}}" ./extension/cmd + + - name: BuildWin32 + uses: addnab/docker-run-action@v3 + with: + image: x1unix/go-mingw:1.20 + options: -v ${{ github.workspace }}:/go/work -w /go/work -e GOARCH=386 -e CGO_ENABLED=1 + + run: | + go build -o ./ifxmetrics.dll -buildmode=c-shared -buildvcs=false -ldflags "-w -s -X main.EXTENSION_VERSION=${{github.ref_name}}-${{github.sha}}" ./extension/cmd diff --git a/README.md b/README.md index 5ddbb5f..b800da2 100644 --- a/README.md +++ b/README.md @@ -144,10 +144,10 @@ Run this from the project root. docker build -t indifox926/build-a3go:linux-so -f ./build/Dockerfile.build . # Compile x64 Linux .so -docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=amd64 -e CGO_ENABLED=1 -e CC=gcc indifox926/build-a3go:linux-so go build -o ./ifxmetrics_x64.so -linkshared -ldflags "-w -s -X main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd +docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=amd64 -e CGO_ENABLED=1 indifox926/build-a3go:linux-so go build -o ./ifxmetrics_x64.so -linkshared -ldflags "-w -s -X main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd # Compile x86 Linux .so -docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=386 -e CGO_ENABLED=1 -e CC=gcc indifox926/build-a3go:linux-so go build -o ./ifxmetrics.so -linkshared -ldflags "-w -s -X main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd +docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=386 -e CGO_ENABLED=1 indifox926/build-a3go:linux-so go build -o ./ifxmetrics.so -linkshared -ldflags "-w -s -X main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd ``` ### ADDON: COMPILE USING HEMTT