LabCodeHub öffentliche Ansicht
Anmelden
Küpper / Quildrop öffentlich

fix: add new action

R Rüdiger Küpper <rpr@9it.de> committete am 19.02.2026 07:43
32ec005e3c167d19fa95c5fa4f9d6a06b3d740d6
2 geänderte Datei(en) +126 −13
Kontextzeilen: 0 1 2 3 10
hinzugefügt .github/workflows/build-and-release.yml
+120 −0 Datei ansehen
@@ -0,0 +1,120 @@
1 +
name: Build and Release
2 +
3 +
on:
4 +
  push:
5 +
    tags:
6 +
      - 'v*'
7 +
  workflow_dispatch:
8 +
    inputs:
9 +
      tag:
10 +
        description: 'Release tag (e.g. v1.2.3)'
11 +
        required: true
12 +
13 +
permissions:
14 +
  contents: write
15 +
16 +
env:
17 +
  BINARY_NAME: quilldrop
18 +
19 +
jobs:
20 +
  build:
21 +
    runs-on: ubuntu-latest
22 +
    strategy:
23 +
      fail-fast: false
24 +
      matrix:
25 +
        include:
26 +
          - goos: linux
27 +
            goarch: amd64
28 +
          - goos: linux
29 +
            goarch: arm64
30 +
          - goos: darwin
31 +
            goarch: amd64
32 +
          - goos: darwin
33 +
            goarch: arm64
34 +
          - goos: windows
35 +
            goarch: arm64
36 +
37 +
    steps:
38 +
      - name: Checkout
39 +
        uses: actions/checkout@v4
40 +
41 +
      - name: Setup Go
42 +
        uses: actions/setup-go@v5
43 +
        with:
44 +
          go-version-file: go.mod
45 +
          cache: true
46 +
47 +
      - name: Build static binary
48 +
        env:
49 +
          GOOS: ${{ matrix.goos }}
50 +
          GOARCH: ${{ matrix.goarch }}
51 +
          CGO_ENABLED: '0'
52 +
        run: |
53 +
          set -euo pipefail
54 +
55 +
          BIN="${BINARY_NAME}-${GOOS}-${GOARCH}"
56 +
          if [ "${GOOS}" = "windows" ]; then
57 +
            BIN="${BIN}.exe"
58 +
          fi
59 +
60 +
          go build -trimpath -ldflags="-s -w" -o "${BIN}" .
61 +
62 +
          mkdir -p dist
63 +
          if [ "${GOOS}" = "windows" ]; then
64 +
            zip "dist/${BINARY_NAME}-${GOOS}-${GOARCH}.zip" "${BIN}"
65 +
          else
66 +
            tar -czf "dist/${BINARY_NAME}-${GOOS}-${GOARCH}.tar.gz" "${BIN}"
67 +
          fi
68 +
69 +
      - name: Generate checksum
70 +
        run: |
71 +
          cd dist
72 +
          sha256sum * > checksums-${{ matrix.goos }}-${{ matrix.goarch }}.txt
73 +
          cat checksums-${{ matrix.goos }}-${{ matrix.goarch }}.txt
74 +
75 +
      - name: Upload artifact
76 +
        uses: actions/upload-artifact@v4
77 +
        with:
78 +
          name: ${{ env.BINARY_NAME }}-${{ matrix.goos }}-${{ matrix.goarch }}
79 +
          path: dist/*
80 +
          if-no-files-found: error
81 +
82 +
  release:
83 +
    needs: build
84 +
    runs-on: ubuntu-latest
85 +
    steps:
86 +
      - name: Download all artifacts
87 +
        uses: actions/download-artifact@v4
88 +
        with:
89 +
          path: artifacts
90 +
          merge-multiple: true
91 +
92 +
      - name: Merge checksums
93 +
        run: |
94 +
          cd artifacts
95 +
          cat checksums-*.txt > checksums.txt
96 +
          rm checksums-*.txt
97 +
          echo "=== checksums.txt ==="
98 +
          cat checksums.txt
99 +
100 +
      - name: Determine tag
101 +
        id: tag
102 +
        run: |
103 +
          if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
104 +
            echo "version=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
105 +
          else
106 +
            echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
107 +
          fi
108 +
109 +
      - name: List release assets
110 +
        run: ls -la artifacts/
111 +
112 +
      - name: Create GitHub Release
113 +
        env:
114 +
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115 +
        run: |
116 +
          gh release create "${{ steps.tag.outputs.version }}" \
117 +
            --repo "${{ github.repository }}" \
118 +
            --title "${{ steps.tag.outputs.version }}" \
119 +
            --generate-notes \
120 +
            artifacts/*
geändert .github/workflows/release-quilldrop.yml
+6 −13 Datei ansehen
@@ -3,4 +3,4 @@ name: build-and-release
3 3
on:
4 -
  push:
5 -
    branches: [main]
4 +
  # push:
5 +
  #   branches: [main]
6 6
  workflow_dispatch:
@@ -73,14 +73,7 @@ jobs:
73 73
      matrix:
74 -
        # goos: [linux,]
75 -
        # goarch: [arm64]
76 -
        goos: [linux, darwin]
74 +
        goos: [linux, darwin, windows]
77 75
        goarch: [amd64, arm64]
78 -
        # goos: [linux, darwin, windows]
79 -
        # goarch: [amd64, arm64,arm]
80 -
        # exclude:
81 -
        #   # ARM 32-bit ist nur für Linux sinnvoll
82 -
        #   - goos: darwin
83 -
        #     goarch: arm
84 -
        #   - goos: windows
85 -
        #     goarch: arm
76 +
        exclude:
77 +
          - goos: windows
78 +
            goarch: amd64
86 79