feat(tools): add workspace-scoped file edit (#35) #24
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: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Test | |
| run: go test ./... | |
| release-please: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - name: Release Please | |
| id: release | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| build-release: | |
| runs-on: ubuntu-latest | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.release-please.outputs.tag_name }} | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Test | |
| run: go test ./... | |
| - name: Build binaries | |
| env: | |
| VERSION: ${{ needs.release-please.outputs.tag_name }} | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| for target in \ | |
| linux/amd64 \ | |
| linux/arm64 \ | |
| darwin/amd64 \ | |
| darwin/arm64 \ | |
| windows/amd64 | |
| do | |
| os="${target%/*}" | |
| arch="${target#*/}" | |
| ext="" | |
| if [ "$os" = "windows" ]; then | |
| ext=".exe" | |
| fi | |
| name="vikusha-${os}-${arch}" | |
| out="dist/${name}${ext}" | |
| GOOS="$os" GOARCH="$arch" go build \ | |
| -trimpath \ | |
| -ldflags "-s -w -X main.version=${VERSION}" \ | |
| -o "$out" \ | |
| ./cmd/vikusha | |
| done | |
| cd dist | |
| sha256sum * > checksums.txt | |
| - name: Upload release assets | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VERSION: ${{ needs.release-please.outputs.tag_name }} | |
| run: gh release upload "${VERSION}" dist/* --clobber |