Merge branch 'develop' into main #146
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: build | |
on: [push] | |
jobs: | |
generate-antlr-sources: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: ./generate_antlr.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: antlr4 | |
path: | | |
pkg/a2l/parser/grammar | |
generate-grpc-sources: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: ./generate_grpc.sh | |
- uses: actions/upload-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: antlr4 | |
path: pkg/a2l/parser | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: antlr4 | |
path: pkg/a2l/parser | |
- uses: actions/download-artifact@v3 | |
with: | |
name: grpc | |
path: pkg/a2l | |
- run: | | |
go get github.com/antlr4-go/antlr/v4 | |
go test ./cmd/a2l/... | |
build-linux: | |
runs-on: ubuntu-22.04 | |
needs: | |
- test-linux | |
- test-windows | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: antlr4 | |
path: pkg/a2l/parser | |
- uses: actions/download-artifact@v3 | |
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@v3 | |
with: | |
name: linux | |
path: | | |
*.so | |
*.h | |
build-windows: | |
runs-on: windows-2019 | |
needs: | |
- test-linux | |
- test-windows | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: antlr4 | |
path: pkg/a2l/parser | |
- uses: actions/download-artifact@v3 | |
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).dll ./cmd/a2l/a2l.go | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: windows | |
path: | | |
*.dll | |
*.h | |
export-protobuf-definitions: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: protobuf | |
path: | | |
protobuf | |
release: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
needs: | |
- build-linux | |
- build-windows | |
- export-protobuf-definitions | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v3 | |
- run: mkdir a2l_grpc | |
- uses: actions/download-artifact@v3 | |
with: | |
name: linux | |
path: a2l_grpc | |
- uses: actions/download-artifact@v3 | |
with: | |
name: windows | |
path: a2l_grpc | |
- uses: actions/download-artifact@v3 | |
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" |