-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (77 loc) · 2.6 KB
/
cd.yaml
File metadata and controls
90 lines (77 loc) · 2.6 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
89
90
name: CD
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# Linux targets — cross-compiled from ubuntu (no ARM runner needed)
- runner: ubuntu-latest
target: bun-linux-x64
artifact: github-code-search-linux-x64
- runner: ubuntu-latest
target: bun-linux-x64-baseline
artifact: github-code-search-linux-x64-baseline
- runner: ubuntu-latest
target: bun-linux-arm64
artifact: github-code-search-linux-arm64
# Windows — cross-compiled from ubuntu
- runner: ubuntu-latest
target: bun-windows-x64
artifact: github-code-search-windows-x64.exe
# macOS — must run on macOS for ad-hoc codesigning
- runner: macos-latest
target: bun-darwin-x64
artifact: github-code-search-macos-x64
- runner: macos-latest
target: bun-darwin-arm64
artifact: github-code-search-macos-arm64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run tests
run: bun test
- name: Build binary
run: bun run build.ts --target=${{ matrix.target }}
- name: Rename artifact
# build.ts outputs dist/github-code-search-<target-without-bun->
# Rename to the canonical artifact name defined in the matrix.
shell: bash
run: |
src="dist/github-code-search-$(echo '${{ matrix.target }}' | sed 's/^bun-//')"
[ -f "${src}.exe" ] && src="${src}.exe"
[ -f "dist/${{ matrix.artifact }}" ] || mv -v "$src" "dist/${{ matrix.artifact }}"
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.artifact }}
release:
name: Create GitHub release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: dist/
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
files: dist/*
generate_release_notes: true