mirror of https://github.com/muety/wakapi.git
fix(build): enable cgo, downgrade release to ubuntu-18.04, add -w -s (#404)
* fix(build): releases with cgo * build: downgrade to ubuntu-18.04 * build: add -w -s flags
This commit is contained in:
parent
4c1f4ed39b
commit
e399af1f1f
|
@ -8,12 +8,29 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: 'Build, package and release to GitHub'
|
name: 'Build, package and release to GitHub'
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
GOOS: [darwin, windows, linux]
|
include:
|
||||||
GOARCH: [amd64, arm64]
|
- platform: ubuntu-18.04
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
CC: gcc
|
||||||
|
- platform: ubuntu-18.04
|
||||||
|
package: gcc-aarch64-linux-gnu
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: arm64
|
||||||
|
CC: aarch64-linux-gnu-gcc
|
||||||
|
- platform: windows-latest
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
- platform: macos-latest
|
||||||
|
GOOS: darwin
|
||||||
|
GOARCH: amd64
|
||||||
|
- platform: macos-latest
|
||||||
|
GOOS: darwin
|
||||||
|
GOARCH: arm64
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
@ -26,6 +43,10 @@ jobs:
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install gcc
|
||||||
|
if: "${{ matrix.package != '' }}"
|
||||||
|
run: sudo apt-get update && sudo apt-get -y install ${{ matrix.package }}
|
||||||
|
|
||||||
- name: Set version
|
- name: Set version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
@ -40,11 +61,20 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ./dist
|
working-directory: ./dist
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
GOOS=${{ matrix.GOOS }} GOARCH=${{ matrix.GOARCH }} go build -v ../
|
GOOS=${{ matrix.GOOS }} GOARCH=${{ matrix.GOARCH }} \
|
||||||
|
CC=${{ matrix.CC }} CGO_ENABLED=1 go build -v -ldflags '-w -s' ../
|
||||||
|
|
||||||
|
- name: Compress working folder (Windows PowerShell)
|
||||||
|
working-directory: ./dist
|
||||||
|
if: "${{ matrix.GOOS == 'windows' }}"
|
||||||
|
run: |
|
||||||
|
Compress-Archive -Path .\wakapi.exe, .\config.yml -DestinationPath wakapi_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.zip
|
||||||
|
|
||||||
- name: Compress working folder
|
- name: Compress working folder
|
||||||
working-directory: ./dist
|
working-directory: ./dist
|
||||||
|
if: "${{ matrix.GOOS != 'windows' }}"
|
||||||
run: |
|
run: |
|
||||||
zip -9 wakapi_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.zip *
|
zip -9 wakapi_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.zip *
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue