rss email digests over ssh because you're a cool kid herald.dunkirk.sh
go rss rss-reader ssh charm
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: use matrix strategy with native runners for CGO builds

+86 -8
+86 -8
.github/workflows/release.yml
··· 9 9 contents: write 10 10 11 11 jobs: 12 - goreleaser: 13 - name: Release with GoReleaser 12 + release: 13 + name: Release 14 14 runs-on: ubuntu-latest 15 15 steps: 16 16 - name: Checkout ··· 18 18 with: 19 19 fetch-depth: 0 20 20 21 + - name: Create Release 22 + env: 23 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 + run: | 25 + gh release create ${{ github.ref_name }} \ 26 + --title "Release ${{ github.ref_name }}" \ 27 + --generate-notes \ 28 + --draft 29 + 30 + build: 31 + name: Build ${{ matrix.goos }}-${{ matrix.goarch }} 32 + needs: release 33 + strategy: 34 + matrix: 35 + include: 36 + - goos: linux 37 + goarch: amd64 38 + runner: ubuntu-latest 39 + - goos: linux 40 + goarch: arm64 41 + runner: ubuntu-latest 42 + - goos: darwin 43 + goarch: amd64 44 + runner: macos-13 45 + - goos: darwin 46 + goarch: arm64 47 + runner: macos-latest 48 + runs-on: ${{ matrix.runner }} 49 + steps: 50 + - name: Checkout 51 + uses: actions/checkout@v4 52 + with: 53 + fetch-depth: 0 54 + 21 55 - name: Setup Go 22 56 uses: actions/setup-go@v5 23 57 with: ··· 25 59 cache: true 26 60 27 61 - name: Install cross-compilation toolchain 62 + if: matrix.goos == 'linux' && matrix.goarch == 'arm64' 28 63 run: | 29 64 sudo apt-get update 30 65 sudo apt-get install -y gcc-aarch64-linux-gnu 31 66 32 - - name: Run GoReleaser 33 - uses: goreleaser/goreleaser-action@v6 34 - with: 35 - distribution: goreleaser 36 - version: '~> v2' 37 - args: release --clean 67 + - name: Build 68 + env: 69 + CGO_ENABLED: 1 70 + GOOS: ${{ matrix.goos }} 71 + GOARCH: ${{ matrix.goarch }} 72 + CC: ${{ matrix.goos == 'linux' && matrix.goarch == 'arm64' && 'aarch64-linux-gnu-gcc' || '' }} 73 + run: | 74 + VERSION="${{ github.ref_name }}" 75 + COMMIT_HASH="$(git rev-parse HEAD)" 76 + BINARY_NAME="herald" 77 + 78 + go build \ 79 + -tags sqlite_foreign_keys \ 80 + -ldflags="-s -w -X main.version=${VERSION} -X main.commitHash=${COMMIT_HASH}" \ 81 + -o ${BINARY_NAME} \ 82 + . 83 + 84 + # Create archive 85 + ARCHIVE_NAME="herald_$(echo ${{ matrix.goos }} | sed 's/.*/\u&/')_${{ matrix.goarch == 'amd64' && 'x86_64' || matrix.goarch }}" 86 + 87 + if [ "${{ matrix.goos }}" = "windows" ]; then 88 + zip "${ARCHIVE_NAME}.zip" ${BINARY_NAME} LICENSE.md README.md config.example.yaml 89 + else 90 + tar czf "${ARCHIVE_NAME}.tar.gz" ${BINARY_NAME} LICENSE.md README.md config.example.yaml 91 + fi 92 + 93 + - name: Upload to Release 38 94 env: 39 95 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 96 + run: | 97 + ARCHIVE_NAME="herald_$(echo ${{ matrix.goos }} | sed 's/.*/\u&/')_${{ matrix.goarch == 'amd64' && 'x86_64' || matrix.goarch }}" 98 + 99 + if [ "${{ matrix.goos }}" = "windows" ]; then 100 + gh release upload ${{ github.ref_name }} "${ARCHIVE_NAME}.zip" 101 + else 102 + gh release upload ${{ github.ref_name }} "${ARCHIVE_NAME}.tar.gz" 103 + fi 104 + 105 + finalize: 106 + name: Finalize Release 107 + needs: build 108 + runs-on: ubuntu-latest 109 + steps: 110 + - name: Checkout 111 + uses: actions/checkout@v4 112 + 113 + - name: Publish Release 114 + env: 115 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 116 + run: | 117 + gh release edit ${{ github.ref_name }} --draft=false