name: Build Process Supervisor on: push: tags: - '*' env: APP_NAME: processSupervisor jobs: build: 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: - name: Checkout repo uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: go-version: '1.24.5' - 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: | 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 artifacts uses: actions/upload-artifact@v3 with: name: ${{ env.APP_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.arm_version && format('v{0}', matrix.arm_version) || '' }}${{ matrix.ext }} path: bin/${{ env.APP_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.arm_version && format('v{0}', matrix.arm_version) || '' }}${{ matrix.ext }}