github: Rework build #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
plugins: | |
name: plugins / ${{matrix.arch}} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: 64 | |
mingw: x86-64 | |
- arch: 32 | |
mingw: i686 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- run: sudo apt install -y gcc-mingw-w64-${{matrix.mingw}} g++-mingw-w64-${{matrix.mingw}} | |
- run: go run . ${{matrix.arch}} CC=${{matrix.mingw}}-w64-mingw32-gcc CXX=${{matrix.mingw}}-w64-mingw32-g++ -a -ldflags '-s -w -extldflags=-static' -trimpath -v -x ./plugins/... | |
# note: -a is needed to prevent caching issues when switching the C compiler (https://pkg.go.dev/cmd/go#hdr-Build_and_test_caching) | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: plugins${{matrix.arch}} | |
path: '*.dll' |