Skip to content

Release Build

Release Build #17

Workflow file for this run

name: Release Build
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
needs: [build-macos, build-linux, build-windows]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Force fetch annotated tags (workaround)
# Workaround for https://github.com/actions/checkout/issues/290
run: git fetch --force --tags
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Release
uses: softprops/action-gh-release@v1
with:
files: "*.zip"
build-windows:
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Force fetch annotated tags (workaround)
# Workaround for https://github.com/actions/checkout/issues/290
run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install ANTLR
run: pip install antlr4-tools
- name: Generate
run: go generate ./...
- name: Test
run: go test -v ./...
- name: Build
run: go build -o scadformat.exe cmd/main.go
- name: Zip Artifact
run: powershell Compress-Archive scadformat.exe windows.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: windows.zip
build-macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Force fetch annotated tags (workaround)
# Workaround for https://github.com/actions/checkout/issues/290
run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install ANTLR
run: pip install antlr4-tools
- name: Generate
run: go generate ./...
- name: Test
run: go test -v ./...
- name: Build
run: go build -o scadformat cmd/main.go
- name: Zip Artifact
run: zip macos.zip scadformat
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: macos.zip
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Force fetch annotated tags (workaround)
# Workaround for https://github.com/actions/checkout/issues/290
run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install ANTLR
run: pip install antlr4-tools
- name: Generate
run: go generate ./...
- name: Test
run: go test -v ./...
- name: Build
run: go build -o scadformat cmd/main.go
- name: Zip Artifact
run: zip linux.zip scadformat
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: linux.zip