name: Go Build Multi-Platform on: push: branches: [ "main" ] tags: - 'v*' pull_request: branches: [ "main" ] 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@08eba0b27e820071cde6df949e0beb9ba4906955 - name: Set up Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 with: go-version: '1.24' - 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@ea165f8d65b6e75b540449e92b4886f43607fa02 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@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: path: ./release-assets - name: List downloaded files (for debugging) run: ls -R ./release-assets - name: Create GitHub Release uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 with: files: ./release-assets/*/*