-
Notifications
You must be signed in to change notification settings - Fork 475
88 lines (77 loc) · 2.63 KB
/
build-cli-artifacts.yml
File metadata and controls
88 lines (77 loc) · 2.63 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build CLI Artifacts
on:
workflow_call:
inputs:
version:
description: CLI package version to build
required: true
type: string
shell:
description: CLI shell to package as the shipped supabase binary
required: true
type: string
ref:
description: Optional git ref or SHA to check out before building
required: false
type: string
default: ""
secrets:
SENTRY_DSN:
required: false
POSTHOG_API_KEY:
required: false
POSTHOG_ENDPOINT:
required: false
permissions:
contents: read
jobs:
build:
name: Build CLI artifacts
runs-on: blacksmith-32vcpu-ubuntu-2404
env:
BUN_SHELL: ${{ inputs.shell }}
VERSION: ${{ inputs.version }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
POSTHOG_ENDPOINT: ${{ secrets.POSTHOG_ENDPOINT }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Setup
uses: ./.github/actions/setup
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: apps/cli-go/go.mod
cache: true
cache-dependency-path: apps/cli-go/go.sum
- name: Pre-download Go modules
working-directory: apps/cli-go
run: go mod download -x
- name: Install nfpm
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt-get update
sudo apt-get install -y nfpm
- name: Sync versions
run: pnpm exec bun apps/cli/scripts/sync-versions.ts --version "${VERSION}"
- name: Build selected shell
run: pnpm exec bun apps/cli/scripts/build.ts --version "${VERSION}" --shell "${BUN_SHELL}"
- name: Verify build artifacts
run: |
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-arm64 cli-linux-arm64-musl cli-linux-x64 cli-linux-x64-musl cli-windows-arm64 cli-windows-x64; do
echo "Checking packages/$pkg/bin/..."
ls -la "packages/$pkg/bin/"
done
echo "Checking dist/..."
ls -la dist/
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cli-build-${{ inputs.shell }}-${{ inputs.version }}
path: |
packages/cli-*/bin/
dist/