forked from canopy-network/canopy
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.58 KB
/
release.yml
File metadata and controls
56 lines (48 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 }}"}}'