π Fix GH workflow to respect rebranding #35
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: Build and Release zmate | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Needed to create releases | |
| jobs: | |
| build: | |
| name: Build for ${{ matrix.goos }} ${{ matrix.goarch }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| goos: [linux, darwin] | |
| goarch: [amd64, arm64] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24.2' | |
| - name: Build binary | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| mkdir -p dist | |
| BIN_NAME="zmate-${GOOS}-${GOARCH}" | |
| GOOS=${GOOS} GOARCH=${GOARCH} go build -o dist/$BIN_NAME . | |
| echo "BIN_NAME=$BIN_NAME" >> $GITHUB_ENV | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.BIN_NAME }} | |
| path: dist/${{ env.BIN_NAME }} | |
| release: | |
| name: Create GitHub Release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: zmate ${{ github.ref_name }} | |
| tag_name: ${{ github.ref_name }} | |
| files: artifacts/**/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |