Skip to content

Update release.yml #107

Update release.yml

Update release.yml #107

Workflow file for this run

# This workflow will build a golang project

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 111, Col: 15): Unexpected symbol: '${{'. Located at position 68 within expression: (github.ref_type == 'branch') && 'Latest build' || 'Release build' ${{ github.ref_name
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Release
on:
workflow_dispatch
jobs:
setup:
name: Setup
uses: ./.github/workflows/release-setup.yml
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, linux-arm64, linux-armv7, linux-riscv64, linux-mipsle, windows, windows-arm64, macos-arm64]
include:
- build: linux
os: ubuntu-22.04
go: 'stable'
archive-name: sslcon-linux-amd64.tar.gz
- build: linux-arm64
os: ubuntu-22.04-arm
go: 'stable'
archive-name: sslcon-linux-arm64.tar.gz
- build: linux-armv7
os: ubuntu-22.04
go: 'stable'
archive-name: sslcon-linux-armv7.tar.gz
- build: linux-riscv64
os: ubuntu-22.04
go: 'stable'
archive-name: sslcon-linux-riscv64.tar.gz
- build: linux-mipsle
os: ubuntu-22.04
go: 'stable'
archive-name: sslcon-linux-mipsle.tar.gz
- build: windows
os: windows-2022
go: 'stable'
archive-name: sslcon-windows10-amd64.7z
- build: windows-arm64
os: windows-11-arm
go: 'stable'
archive-name: sslcon-windows10-arm64.7z
- build: macos-arm64
os: macos-14
go: 'stable'
archive-name: sslcon-macOS-arm64.tar.gz
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: go get .
- name: Build
shell: bash
run: |
if [ "${{ matrix.build }}" = "linux" ]; then
go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go
go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go
elif [ "${{ matrix.build }}" = "linux-arm64" ]; then
go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go
go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go
elif [ "${{ matrix.build }}" = "linux-armv7" ]; then
GOARM=7 GOARCH=arm go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go
GOARM=7 GOARCH=arm go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go
elif [ "${{ matrix.build }}" = "linux-riscv64" ]; then
GOARCH=riscv64 go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go
GOARCH=riscv64 go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go
elif [ "${{ matrix.build }}" = "linux-mipsle" ]; then
GOARCH=mipsle go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go
GOARCH=mipsle go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go
elif [ "${{ matrix.build }}" = "windows" ]; then
go build -trimpath -ldflags "-s -w" -o vpnagent.exe vpnagent.go
go build -trimpath -ldflags "-s -w" -o sslcon.exe sslcon.go
elif [ "${{ matrix.build }}" = "windows-arm64" ]; then
go build -trimpath -ldflags "-s -w" -o vpnagent.exe vpnagent.go
go build -trimpath -ldflags "-s -w" -o sslcon.exe sslcon.go
elif [ "${{ matrix.build }}" = "macos-arm64" ]; then
go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go
go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go
fi
- name: Build archive
shell: bash
run: |
mkdir archive
cp LICENSE README.md archive/
# ls -lR
if [[ "${{ matrix.build }}" = windows* ]]; then
cp vpnagent.exe sslcon.exe ./archive/
cd archive
7z a "${{ matrix.archive-name }}" LICENSE README.md vpnagent.exe sslcon.exe
else
cp vpnagent sslcon ./archive/
cd archive
tar -czf "${{ matrix.archive-name }}" LICENSE README.md vpnagent sslcon
fi
- name: Release
uses: softprops/action-gh-release@v2
with:
files: archive/${{ matrix.archive-name }}
tag_name: ${{ (github.ref_type == 'branch') && 'latest' || github.ref_name }}
name: ${{ (github.ref_type == 'branch') && 'Latest build' || 'Release build' ${{ github.ref_name }} }}