Update README.md #31
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 & Release RediCLI | |
| on: | |
| push: | |
| branches: | |
| - deployed # Runs when you push/merge to the `deployed` branch | |
| workflow_dispatch: # Allows manual trigger from GitHub Actions UI | |
| permissions: | |
| contents: write # Required to create releases | |
| jobs: | |
| build: | |
| name: Build RediCLI for Multiple Platforms | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.5' # Use your Go version | |
| - name: Get Release Version | |
| id: version | |
| run: echo "VERSION=v${{ secrets.VERSION }}" >> $GITHUB_ENV | |
| - name: Build for Linux (x86_64) | |
| run: GOOS=linux GOARCH=amd64 go build -o redicli-linux | |
| - name: Build for macOS (x86_64) | |
| run: GOOS=darwin GOARCH=amd64 go build -o redicli-mac | |
| - name: Build for macOS (Apple Silicon) | |
| run: GOOS=darwin GOARCH=arm64 go build -o redicli-mac-arm64 | |
| - name: Build for Windows (x86_64) | |
| run: GOOS=windows GOARCH=amd64 go build -o redicli.exe | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Binaries to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| files: | | |
| redicli-linux | |
| redicli-mac | |
| redicli-mac-arm64 | |
| redicli.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |