[NEW AUTH SERVICE WITH JWT AND API TOKENS IN MIDDLEWARE] #38
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Trigger on version tags like v1.0.0 | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| go-version: ["1.20"] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Create release dir | |
| run: mkdir -p release | |
| - name: Build binary | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
| GOOS=linux GOARCH=amd64 go build -o release/gores-linux-amd64 main.go | |
| elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
| GOOS=darwin GOARCH=amd64 go build -o release/gores-darwin-amd64 main.go | |
| else | |
| GOOS=windows GOARCH=amd64 go build -o release/gores-windows-amd64.exe main.go | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-binary | |
| path: release/* | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Linux artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ubuntu-latest-binary | |
| path: release | |
| - name: Download macOS artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-latest-binary | |
| path: release | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-latest-binary | |
| path: release | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: 🚀 Go Microservice Boilerplate ${{ github.ref_name }} | |
| files: | | |
| release/gores-linux-amd64 | |
| release/gores-darwin-amd64 | |
| release/gores-windows-amd64.exe | |
| body: | | |
| ## 📦 Go Microservice Boilerplate — ${{ github.ref_name }} | |
| Precompiled binaries are available for **Linux**, **macOS**, and **Windows**. | |
| ### 🔽 1. Download Binaries | |
| - **Linux (x86_64)** → [gores-linux-amd64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/gores-linux-amd64) | |
| - **macOS (x86_64)** → [gores-darwin-amd64](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/gores-darwin-amd64) | |
| - **Windows (x86_64)** → [gores-windows-amd64.exe](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/gores-windows-amd64.exe) | |
| #### Linux / macOS | |
| ```bash | |
| curl -L -o gores https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/gores-linux-amd64 | |
| chmod +x gores | |
| ./gores | |
| ``` | |
| #### Windows (PowerShell) | |
| ```powershell | |
| Invoke-WebRequest -Uri "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/gores-windows-amd64.exe" -OutFile "gores.exe" | |
| .\gores.exe | |
| ``` | |
| --- | |
| ### 💻 2. Install via `go install` (Go 1.17+) | |
| ```bash | |
| go install github.com/${{ github.repository }}@${{ github.ref_name }} | |
| ``` | |
| This will install the binary into your `$GOPATH/bin` or `$HOME/go/bin`. | |
| --- | |
| ### 📥 3. Install via `go get` (older Go versions) | |
| ```bash | |
| go get github.com/${{ github.repository }}@${{ github.ref_name }} | |
| ``` | |
| --- | |
| ### 🛠 4. Build from Source | |
| ```bash | |
| git clone https://github.com/${{ github.repository }}.git | |
| cd $(basename $_ .git) | |
| go mod tidy | |
| go build -o gores ./cmd | |
| ``` | |
| --- | |
| ### 📚 Documentation | |
| For full docs and usage examples, see [README.md](https://github.com/${{ github.repository }}#readme) | |
| --- | |
| _Built automatically via GitHub Actions._ | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.MY_PAT }} |