Release #4
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: | |
| release: | |
| # windowsgui ビルドの動作環境と揃えるため Windows ランナーを使う | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Run tests | |
| run: go test ./... | |
| - name: Build binaries | |
| shell: bash | |
| # -trimpath: バイナリからビルドマシンのローカルパスを除去 | |
| # grepnaviw.exe: コンソールを持たない windowsgui ビルド。 | |
| # ダブルクリックでトレイ常駐する(defaultTray 焼き込み) | |
| run: | | |
| mkdir -p dist/grepnavi | |
| go build -trimpath -ldflags "-s -w" -o dist/grepnavi/grepnavi.exe . | |
| go build -trimpath -ldflags "-s -w -H=windowsgui -X main.defaultTray=1" -o dist/grepnavi/grepnaviw.exe . | |
| cp -r static dist/grepnavi/static | |
| cp README.md LICENSE dist/grepnavi/ | |
| - name: Create archive | |
| shell: pwsh | |
| run: Compress-Archive -Path dist/grepnavi -DestinationPath "grepnavi-${{ github.ref_name }}-windows-amd64.zip" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: grepnavi-*.zip | |
| generate_release_notes: true |