Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d5f314dad2 | ||
![]() |
988a332249 | ||
29d91d1133 | |||
f40c54ebc1 | |||
![]() |
c47a664f1f | ||
9a1bb814ee | |||
d2a563588c |
@@ -1,6 +1,9 @@
|
|||||||
name: Build Process Supervisor
|
name: Build Process Supervisor
|
||||||
|
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
APP_NAME: processSupervisor
|
APP_NAME: processSupervisor
|
||||||
@@ -9,6 +12,23 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: windows
|
||||||
|
arch: amd64
|
||||||
|
ext: .exe
|
||||||
|
- os: linux
|
||||||
|
arch: amd64
|
||||||
|
ext: ""
|
||||||
|
- os: linux
|
||||||
|
arch: arm64
|
||||||
|
ext: ""
|
||||||
|
- os: linux
|
||||||
|
arch: arm
|
||||||
|
arm_version: 6
|
||||||
|
ext: ""
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -16,44 +36,35 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 'stable'
|
go-version: '1.24.5'
|
||||||
|
|
||||||
- name: Build for Windows amd64
|
- name: Cache Go modules
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
- name: Download Go dependencies
|
||||||
|
run: go mod download
|
||||||
|
|
||||||
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/${APP_NAME}-windows-amd64.exe ./...
|
OUTPUT="bin/${APP_NAME}-${{ matrix.os }}-${{ matrix.arch }}"
|
||||||
|
if [ -n "${{ matrix.arm_version }}" ]; then
|
||||||
|
OUTPUT="${OUTPUT}v${{ matrix.arm_version }}"
|
||||||
|
export GOARM=${{ matrix.arm_version }}
|
||||||
|
fi
|
||||||
|
OUTPUT="${OUTPUT}${{ matrix.ext }}"
|
||||||
|
echo "Building $OUTPUT"
|
||||||
|
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -ldflags="-s -w" -trimpath -o "$OUTPUT"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Upload Windows amd64 binary
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{env.APP_NAME}}-windows-amd64.exe
|
name: ${{ env.APP_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.arm_version && format('v{0}', matrix.arm_version) || '' }}${{ matrix.ext }}
|
||||||
path: bin/${{env.APP_NAME}}-windows-amd64.exe
|
path: bin/${{ env.APP_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.arm_version && format('v{0}', matrix.arm_version) || '' }}${{ matrix.ext }}
|
||||||
|
|
||||||
- name: Build for Linux amd64
|
|
||||||
run: |
|
|
||||||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/${APP_NAME}-linux-amd64 ./...
|
|
||||||
|
|
||||||
- name: Upload Linux amd64
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{env.APP_NAME}}-linux-amd64
|
|
||||||
path: bin/${{env.APP_NAME}}-linux-amd64
|
|
||||||
|
|
||||||
- name: Build for Linux arm64
|
|
||||||
run: |
|
|
||||||
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/${APP_NAME}-linux-arm64 ./...
|
|
||||||
|
|
||||||
- name: Upload Linux arm64
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{env.APP_NAME}}-linux-arm64
|
|
||||||
path: bin/${{env.APP_NAME}}-linux-arm64
|
|
||||||
|
|
||||||
- name: Build for Linux armv6 (Raspberry Pi)
|
|
||||||
run: |
|
|
||||||
GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -trimpath -o bin/${APP_NAME}-linux-armv6 ./...
|
|
||||||
|
|
||||||
- name: Upload Linux armv6 (Raspberry Pi)
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{env.APP_NAME}}-linux-armv6
|
|
||||||
path: bin/${{env.APP_NAME}}-linux-armv6
|
|
Reference in New Issue
Block a user