-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (57 loc) · 1.55 KB
/
release.yml
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
---
name: Release Envy CLI
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux-x64
- linux-arm64
- windows-x64
- darwin-x64
- darwin-arm64
steps:
- uses: actions/checkout@v3
- name: Use Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build CLI
run: |
bun build --compile --minify --sourcemap ./src/bin.ts --target bun-${{ matrix.platform }} --outfile ./dist/${{ matrix.platform }}
# Upload the built CLI as an artifact for the release job to use later
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: cli-builds
path: ./dist/${{ matrix.platform }}
release:
runs-on: ubuntu-latest
needs: build # Wait for all builds to finish
steps:
# Checkout the repository to ensure git is available
- uses: actions/checkout@v3
- name: Download all build artifacts
uses: actions/download-artifact@v3
with:
name: cli-builds
- name: Print builds
run: ls ./dist -R
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
# Create a single release for all platforms
gh release create "$tag" \
--title="$tag" \
--draft \
./dist/**
...