Skip to content

add 32 bits dll for windows #167

add 32 bits dll for windows

add 32 bits dll for windows #167

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
generate-antlr-sources:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: ./generate_antlr.sh
- uses: actions/upload-artifact@v4
with:
name: antlr4
path: |
pkg/a2l/parser/grammar
generate-grpc-sources:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: ./generate_grpc.sh
- uses: actions/upload-artifact@v4
with:
name: grpc
path: |
pkg/a2l/protobuf
test-linux:
runs-on: ubuntu-22.04
needs:
- generate-antlr-sources
- generate-grpc-sources
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: antlr4
path: pkg/a2l/parser
- uses: actions/download-artifact@v4
with:
name: grpc
path: pkg/a2l
- run: |
go get github.com/antlr4-go/antlr/v4
go test ./cmd/a2l/...
test-windows:
runs-on: windows-2019
needs:
- generate-antlr-sources
- generate-grpc-sources
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: antlr4
path: pkg/a2l/parser
- uses: actions/download-artifact@v4
with:
name: grpc
path: pkg/a2l
- run: |
go get github.com/antlr4-go/antlr/v4
go test ./cmd/a2l/...
# test-mac:
# runs-on: macos-latest-xlarge
# needs:
# - generate-antlr-sources
# - generate-grpc-sources
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# name: antlr4
# path: pkg/a2l/parser
# - uses: actions/download-artifact@v4
# with:
# name: grpc
# path: pkg/a2l
# - name: Set up Go 1.21
# uses: actions/setup-go@v4
# with:
# go-version: "1.21"
# cache: true
# - run: |
# go get github.com/antlr4-go/antlr/v4
# go test ./cmd/a2l/...
build-linux:
runs-on: ubuntu-22.04
needs:
- test-linux
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: antlr4
path: pkg/a2l/parser
- uses: actions/download-artifact@v4
with:
name: grpc
path: pkg/a2l
- run: |
go get github.com/antlr4-go/antlr/v4
go build --buildmode=c-shared -o a2l_grpc_$(go env GOOS)_$(go env GOARCH).so ./cmd/a2l/a2l.go
- uses: actions/upload-artifact@v4
with:
name: linux
path: |
*.so
*.h
build-windows:
runs-on: windows-2019
needs:
- test-windows
strategy:
matrix:
mingw: [ "MINGW32", "MINGW64" ]
include:
- mingw: "MINGW32"
path: "C:/msys64/mingw32/bin"
GOARCH: 386
- mingw: "MINGW64"
path: "C:/msys64/usr/bin"
GOARCH: amd64
env:
CGO_ENABLED: 1
GOARCH: ${{ matrix.GOARCH }}
name: MSYS2 ${{ matrix.mingw }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: antlr4
path: pkg/a2l/parser
- uses: actions/download-artifact@v4
with:
name: grpc
path: pkg/a2l
- name: Print system version
shell: powershell
run: |
uname
- shell: powershell
run: |
go get github.com/antlr4-go/antlr/v4
$env:PATH="${{ matrix.path }};$env:PATH" ;go build --buildmode=c-shared -o a2l_grpc_$(go env GOOS)_${{ matrix.GOARCH }}.dll ./cmd/a2l/a2l.go
- uses: actions/upload-artifact@v4
with:
name: windows_${{ matrix.GOARCH }}
path: |
*.dll
*.h
# build-mac:
# runs-on: macos-latest-xlarge
# needs:
# - test-mac
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# name: antlr4
# path: pkg/a2l/parser
# - uses: actions/download-artifact@v4
# with:
# name: grpc
# path: pkg/a2l
# - name: Set up Go 1.21
# uses: actions/setup-go@v4
# with:
# go-version: "1.21"
# cache: true
# - run: |
# go get github.com/antlr4-go/antlr/v4
# go build --buildmode=c-shared -o a2l_grpc_$(go env GOOS)_$(go env GOARCH).dylib ./cmd/a2l/a2l.go
# - uses: actions/upload-artifact@v4
# with:
# name: mac
# path: |
# *.dylib
# *.h
export-protobuf-definitions:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: protobuf
path: |
protobuf
release:
runs-on: ubuntu-22.04
permissions:
contents: write
needs:
- build-linux
- build-windows
# - build-mac
- export-protobuf-definitions
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- run: mkdir a2l_grpc
- uses: actions/download-artifact@v4
with:
name: linux
path: a2l_grpc
- uses: actions/download-artifact@v4
with:
name: windows
path: a2l_grpc
# - uses: actions/download-artifact@v4
# with:
# name: mac
# path: a2l_grpc
- uses: actions/download-artifact@v4
with:
name: protobuf
path: a2l_grpc/protobuf
- run: |
tar czf a2l_grpc.tar.gz a2l_grpc
rm -rf a2l_grpc
- uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
commit: main
artifacts: "a2l_grpc.tar.gz"
bodyFile: "CHANGELOG.md"