Skip to content

Build Release

Build Release #2

Workflow file for this run

name: Build Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
# cache dependencies
cache-dependency-path: go.sum
- name: Build
run: |
mkdir -p build
export SST_VERSION="`date +"%Y.%m.%d"`.`git rev-parse --short HEAD`"
export LDFLAGS="-X \"main.Version=$SST_VERSION\""
export GOOS=windows; export GOARCH=amd64; go build -ldflags "$LDFLAGS" -o build/esm-$GOOS-$GOARCH.exe -v -buildmode=exe .
export GOOS=windows; export GOARCH=arm64; go build -ldflags "$LDFLAGS" -o build/esm-$GOOS-$GOARCH.exe -v -buildmode=exe .
export GOOS=linux; export GOARCH=amd64; go build -ldflags "$LDFLAGS" -o build/esm-$GOOS-$GOARCH -v -buildmode=exe .
export GOOS=linux; export GOARCH=arm64; go build -ldflags "$LDFLAGS" -o build/esm-$GOOS-$GOARCH -v -buildmode=exe .
export GOOS=darwin; export GOARCH=amd64; go build -ldflags "$LDFLAGS" -o build/esm-$GOOS-$GOARCH -v -buildmode=exe .
export GOOS=darwin; export GOARCH=arm64; go build -ldflags "$LDFLAGS" -o build/esm-$GOOS-$GOARCH -v -buildmode=exe .
env:
GO111MODULE: on
# macos not support
CGO_ENABLED: 0
PROJ_ROOT: ${{ github.workspace }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.3
with:
# Artifact name
name: esm # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: build/*
# The desired behavior if no files are found using the provided path.
# The level of compression for Zlib to be applied to the artifact archive. The value can range from 0 to 9: - 0: No compression - 1: Best speed - 6: Default compression (same as GNU Gzip) - 9: Best compression Higher levels will result in better compression, but will take longer to complete. For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
compression-level: 0