From 252aebce4be5eef5d859996cd90ffb772314333c Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Sat, 11 Sep 2021 11:15:15 +0530 Subject: [PATCH] fix: add different jobs for windows and darwin with expected Go envs --- .github/workflows/release.yaml | 40 +++++++++++++++++++++++++++++++--- Makefile | 2 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4c1c049..92b44fb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,37 @@ on: types: [created] jobs: - releases-matrix: + - releases-windows: + name: Release Authorizer Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64 + goos: [windows] + goarch: [amd64] + # goarch: ['386', amd64] + # exclude: + # - goarch: '386' + # goos: darwin + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: sudo apt-get install build-essential gcc_mingw64 + - name: Set VERSION env + run: echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV} + - name: Set GO env + env: + - CGO_ENABLED=1 + - CC=x86_64-w64-mingw32-gcc + - uses: wangyoucao577/go-release-action@v1.20 + with: + github_token: ${{ secrets.RELEASE_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + build_command: make clean && make + md5sum: FALSE + extra_files: .env.sample app build template + - releases-darwin: name: Release Authorizer Binary runs-on: ubuntu-latest strategy: @@ -17,10 +47,14 @@ jobs: # goos: darwin steps: - uses: actions/checkout@v2 - - name: Install xmllint - run: sudo apt-get install build-essential + - name: Install dependencies + run: sudo apt-get install build-essential gcc g++ zlib1g-dev libmpc-dev libmpfr-dev libgmp-dev - name: Set VERSION env run: echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV} + - name: Set GO env + env: + - CGO_ENABLED=1 + - CC=o64-clang - uses: wangyoucao577/go-release-action@v1.20 with: github_token: ${{ secrets.RELEASE_TOKEN }} diff --git a/Makefile b/Makefile index 1d51e83..b23c462 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,6 @@ DEFAULT_VERSION=0.1.0-local VERSION := $(or $(VERSION),$(DEFAULT_VERSION)) cmd: - cd server && CGO_ENABLED=1 go build -ldflags "-w -X main.Version=$(VERSION)" -o '../build/server' + cd server && go build -ldflags "-w -X main.Version=$(VERSION)" -o '../build/server' clean: rm -rf build \ No newline at end of file