fix: add armv7 (raspberrypi), GOARCH to buildsteps
R
Rüdiger Küpper
<rpr@9it.de>
committete am 19.02.2026 09:09
bb015662a4847b639e177b5cebba7e0b16dec46f
| @@ -20,20 +20,23 @@ jobs: | ||
| 20 | 20 | build: |
| 21 | 21 | runs-on: ubuntu-latest |
| 22 | 22 | strategy: |
| 23 | 23 | fail-fast: false |
| 24 | 24 | matrix: |
| 25 | 25 | include: |
| 26 | 26 | - goos: linux |
| 27 | 27 | goarch: amd64 |
| 28 | 28 | - goos: linux |
| 29 | 29 | goarch: arm64 |
| 30 | +- goos: linux |
|
| 31 | +goarch: arm |
|
| 32 | +goarm: '7' |
|
| 30 | 33 | - goos: darwin |
| 31 | 34 | goarch: amd64 |
| 32 | 35 | - goos: darwin |
| 33 | 36 | goarch: arm64 |
| 34 | 37 | - goos: windows |
| 35 | 38 | goarch: arm64 |
| 36 | 39 | |
| 37 | 40 | steps: |
| 38 | 41 | - name: Checkout |
| 39 | 42 | uses: actions/checkout@v4 |
| @@ -41,48 +44,56 @@ jobs: | ||
| 41 | 44 | - name: Setup Go |
| 42 | 45 | uses: actions/setup-go@v5 |
| 43 | 46 | with: |
| 44 | 47 | go-version-file: go.mod |
| 45 | 48 | cache: true |
| 46 | 49 | |
| 47 | 50 | - name: Build static binary |
| 48 | 51 | env: |
| 49 | 52 | GOOS: ${{ matrix.goos }} |
| 50 | 53 | GOARCH: ${{ matrix.goarch }} |
| 54 | + GOARM: ${{ matrix.goarm }} |
|
| 51 | 55 | CGO_ENABLED: '0' |
| 52 | 56 | run: | |
| 53 | 57 | set -euo pipefail |
| 54 | 58 | |
| 55 | - BIN="${BINARY_NAME}-${GOOS}-${GOARCH}" |
|
| 59 | + SUFFIX="${GOOS}-${GOARCH}" |
|
| 60 | + if [ -n "${GOARM}" ]; then |
|
| 61 | + SUFFIX="${SUFFIX}v${GOARM}" |
|
| 62 | +fi |
|
| 63 | + | |
| 64 | + BIN="${BINARY_NAME}-${SUFFIX}" |
|
| 56 | 65 | if [ "${GOOS}" = "windows" ]; then |
| 57 | 66 | BIN="${BIN}.exe" |
| 58 | 67 | fi |
| 59 | 68 | |
| 60 | 69 | go build -trimpath -ldflags="-s -w" -o "${BIN}" . |
| 61 | 70 | |
| 62 | 71 | mkdir -p dist |
| 63 | 72 | if [ "${GOOS}" = "windows" ]; then |
| 64 | - zip "dist/${BINARY_NAME}-${GOOS}-${GOARCH}.zip" "${BIN}" |
|
| 73 | + zip "dist/${BINARY_NAME}-${SUFFIX}.zip" "${BIN}" |
|
| 65 | 74 | else |
| 66 | - tar -czf "dist/${BINARY_NAME}-${GOOS}-${GOARCH}.tar.gz" "${BIN}" |
|
| 75 | + tar -czf "dist/${BINARY_NAME}-${SUFFIX}.tar.gz" "${BIN}" |
|
| 67 | 76 | fi |
| 68 | 77 | |
| 69 | 78 | - name: Generate checksum |
| 79 | +env: |
|
| 80 | + SUFFIX: ${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }} |
|
| 70 | 81 | run: | |
| 71 | 82 | cd dist |
| 72 | - sha256sum * > checksums-${{ matrix.goos }}-${{ matrix.goarch }}.txt |
|
| 73 | - cat checksums-${{ matrix.goos }}-${{ matrix.goarch }}.txt |
|
| 83 | + sha256sum * > checksums-${SUFFIX}.txt |
|
| 84 | + cat checksums-${SUFFIX}.txt |
|
| 74 | 85 | |
| 75 | 86 | - name: Upload artifact |
| 76 | 87 | uses: actions/upload-artifact@v4 |
| 77 | 88 | with: |
| 78 | - name: ${{ env.BINARY_NAME }}-${{ matrix.goos }}-${{ matrix.goarch }} |
|
| 89 | + name: ${{ env.BINARY_NAME }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }} |
|
| 79 | 90 | path: dist/* |
| 80 | 91 | if-no-files-found: error |
| 81 | 92 | |
| 82 | 93 | release: |
| 83 | 94 | needs: build |
| 84 | 95 | runs-on: ubuntu-latest |
| 85 | 96 | steps: |
| 86 | 97 | - name: Download all artifacts |
| 87 | 98 | uses: actions/download-artifact@v4 |
| 88 | 99 | with: |