refactor: rename project to IncottHIDApp #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: Run tests | |
| run: go test -v ./... | |
| - name: Compile Windows resource (icon) | |
| shell: pwsh | |
| run: | | |
| $windres = (Get-Command windres -ErrorAction SilentlyContinue).Source | |
| if (-not $windres) { | |
| $windres = "C:\msys64\mingw64\bin\windres.exe" | |
| } | |
| Push-Location icons | |
| & $windres app.rc -o ../app_windows.syso | |
| Pop-Location | |
| - name: Build binary | |
| env: | |
| CGO_ENABLED: 1 | |
| run: go build -o IncottHIDApp.exe -ldflags="-H windowsgui -s -w -X main.version=${{ github.ref_name }}" . | |
| - name: Extract tag annotation | |
| shell: bash | |
| run: | | |
| # Ensure annotated tag object is available locally | |
| git fetch --tags --force | |
| # Prefer annotated tag message (strips header/PGP); fall back if lightweight | |
| git cat-file -p "${{ github.ref_name }}" 2>/dev/null | sed '1,/^$/d' > release_body.md || true | |
| if [ ! -s release_body.md ]; then | |
| echo "Release ${{ github.ref_name }}" > release_body.md | |
| fi | |
| echo "--- release body ---" | |
| cat release_body.md | |
| echo "--- end ---" | |
| - name: Create or update release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| if gh release view "$TAG" >/dev/null 2>&1; then | |
| echo "Release $TAG exists — updating notes and asset" | |
| gh release edit "$TAG" --notes-file release_body.md | |
| gh release upload "$TAG" IncottHIDApp.exe --clobber | |
| else | |
| echo "Creating new release $TAG" | |
| gh release create "$TAG" IncottHIDApp.exe --notes-file release_body.md --title "$TAG" | |
| fi |