name: Go Build Multi-Platform on: push: branches: [ "main", "master" ] tags: - 'v*' pull_request: branches: [ "main", "master" ] jobs: build: permissions: contents: write strategy: matrix: goos: [linux, windows, darwin, freebsd] goarch: [amd64, arm64, arm] exclude: - goos: darwin goarch: arm runs-on: ubuntu-latest outputs: build_complete: ${{ steps.build_step.outcome == 'success' }} steps: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: go-version: '1.25' - name: Build id: build_step env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} GOARM: ${{ matrix.goarch == 'arm' && '6' || '' }} run: | output_name="reticulum-go-${GOOS}-${GOARCH}" if [ "$GOOS" = "windows" ]; then output_name+=".exe" fi go build -v -ldflags="-s -w" -o "${output_name}" ./cmd/reticulum-go echo "Built: ${output_name}" - name: Calculate SHA256 Checksum run: | output_name="reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}" if [ "${{ matrix.goos }}" = "windows" ]; then output_name+=".exe" fi sha256sum "${output_name}" > "${output_name}.sha256" echo "Calculated SHA256 for ${output_name}" - name: Upload Artifact uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }} path: reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}* release: name: Create Release runs-on: ubuntu-latest needs: build if: startsWith(github.ref, 'refs/tags/') permissions: contents: write steps: - name: Download All Build Artifacts uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: path: ./release-assets - name: List downloaded files (for debugging) run: ls -R ./release-assets - name: Create GitHub Release uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1 with: files: ./release-assets/*/*