-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (66 loc) · 2.7 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (66 loc) · 2.7 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
name: Release
# Triggers on version tag pushes (e.g., v1.2.3)
#
# Prerequisites:
# - NPM_TOKEN secret configured in repository settings (required for npm publishing)
# - GITHUB_TOKEN is provided automatically by GitHub Actions
#
# What this workflow does:
# 1. Builds 12 platform binaries (Linux/Darwin/Windows × arm64/x64 × baseline variants)
# 2. Creates GitHub Release with auto-generated notes
# 3. Uploads binary archives as release assets (.tar.gz for Linux, .zip for Darwin/Windows)
# 4. Publishes to npm registry (tinycode-ai + platform-specific packages)
# 5. Updates Docker, AUR, and Homebrew registries (non-preview releases only)
on:
push:
tags:
- "v*"
permissions:
contents: write # Required for creating releases and uploading assets
packages: write # Required for Docker image publishing
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes --draft
- name: Build binaries and upload to release
env:
TINYCODE_VERSION: ${{ github.ref_name }}
TINYCODE_RELEASE: "true"
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run packages/tinycode/script/build.ts
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release edit ${{ github.ref_name }} --draft=false
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
- name: Log in to GHCR
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm and registries
env:
TINYCODE_VERSION: ${{ github.ref_name }}
TINYCODE_RELEASE: "true"
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure npm authentication
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# Run publish script (handles npm, Docker, AUR, Homebrew)
bun run packages/tinycode/script/publish.ts