v6.4.1 #14
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 | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [linux, windows, darwin] | |
| arch: [amd64, arm64] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| - name: Set environment variables | |
| run: | | |
| echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | |
| echo "CGO_ENABLED=0" >> $GITHUB_ENV | |
| echo "GOOS=${{ matrix.os }}" >> $GITHUB_ENV | |
| echo "GOARCH=${{ matrix.arch }}" >> $GITHUB_ENV | |
| if [ "${{ matrix.os }}" = "windows" ]; then | |
| echo "EXT=.exe" >> $GITHUB_ENV | |
| else | |
| echo "EXT=" >> $GITHUB_ENV | |
| fi | |
| - name: Build binary | |
| run: | | |
| mkdir dist | |
| go build \ | |
| -o dist/filimo-plus-cli-${{ env.TAG_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ env.EXT }} \ | |
| -ldflags="-X main.isProduction=true -w -s -buildid=" \ | |
| -trimpath \ | |
| ./cmd/filimo-plus-cli | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.os }}-${{ matrix.arch }} | |
| path: dist/* | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| tag_name: ${{ github.ref_name }} | |
| files: dist/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |