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 Go Binaries | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build: | |
| name: Build and Publish | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [darwin, windows, linux] | |
| arch: [arm64, amd64] | |
| include: | |
| - os: windows | |
| extension: .exe | |
| permissions: | |
| contents: write | |
| actions: write | |
| id-token: write | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Get release version | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Build binaries | |
| env: | |
| VERSION: ${{ steps.get_version.outputs.VERSION }} | |
| GOOS: ${{ matrix.os }} | |
| GOARCH: ${{ matrix.arch }} | |
| run: | | |
| go build -ldflags="-X 'main.Version=$VERSION'" -o release/jjui-$VERSION-${{ matrix.os }}-${{ matrix.arch }}${{matrix.extension}} cmd/jjui/main.go | |
| zip -j release/jjui-$VERSION-${{ matrix.os }}-${{ matrix.arch }}.zip release/jjui-$VERSION-${{ matrix.os }}-${{ matrix.arch }}${{matrix.extension}} | |
| - name: Upload release binaries | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: release/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |