Repository navigation
implented shift enter, but I don't think it works #44
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run tests | |
| run: make test | |
| - name: Run vet | |
| run: make lint | |
| - name: Check Windows build graph | |
| run: make test-windows | |
| build-windows: | |
| name: Build Windows (${{ matrix.arch }}) | |
| runs-on: ubuntu-latest | |
| needs: test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [amd64, arm64] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build Windows binary | |
| run: | | |
| mkdir -p dist | |
| GOOS=windows GOARCH=${{ matrix.arch }} GOCACHE=/tmp/vimwhat-go-build go build -trimpath -o dist/vimwhat-windows-${{ matrix.arch }}.exe ./cmd/vimwhat | |
| - name: Upload Windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vimwhat-windows-${{ matrix.arch }} | |
| path: dist/vimwhat-windows-${{ matrix.arch }}.exe | |
| if-no-files-found: error | |
| release-windows: | |
| name: Publish latest Windows release | |
| runs-on: ubuntu-latest | |
| needs: build-windows | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download Windows amd64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: vimwhat-windows-amd64 | |
| path: dist | |
| - name: Download Windows arm64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: vimwhat-windows-arm64 | |
| path: dist | |
| - name: Publish stable release assets | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| RELEASE_TAG: windows-latest | |
| run: | | |
| set -euo pipefail | |
| notes="Automated Windows build from ${GITHUB_SHA}." | |
| if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then | |
| gh release edit "$RELEASE_TAG" --title "Latest Windows build" --notes "$notes" --latest | |
| else | |
| gh release create "$RELEASE_TAG" --target "$GITHUB_SHA" --title "Latest Windows build" --notes "$notes" --latest | |
| fi | |
| gh release upload "$RELEASE_TAG" dist/vimwhat-windows-amd64.exe dist/vimwhat-windows-arm64.exe --clobber |