Release #24
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: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag for the release (e.g. v1.0.0)" | |
| required: true | |
| permissions: | |
| # required for GITHUB_TOKEN to create a release | |
| contents: write | |
| jobs: | |
| release: | |
| name: Build and Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Build binaries | |
| run: | | |
| make build/wallet | |
| make build/explorer | |
| mkdir -p dist | |
| # AMD64 build | |
| GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -a -o dist/cli-linux-amd64 ./cmd/main/... | |
| # ARM64 build | |
| GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -o dist/cli-linux-arm64 ./cmd/main/... | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag }} | |
| target_commitish: ${{ github.sha }} | |
| files: | | |
| dist/cli-linux-amd64 | |
| dist/cli-linux-arm64 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Dispatch to Docker release repo | |
| run: | | |
| curl -X POST https://api.github.com/repos/canopy-network/deployments/dispatches \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" \ | |
| -d '{"event_type":"docker-release","client_payload":{"tag":"${{ github.event.inputs.tag }}"}}' |