-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (91 loc) · 2.44 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
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
91
92
93
94
95
96
97
98
99
100
101
102
name: Release
on:
pull_request:
branches: ['main']
paths:
- .github/workflows/release.yml
- .goreleaser.yaml
push:
branches: ['main']
tags: ['v*.*.*']
paths:
- .github/workflows/release.yml
- cli/**
jobs:
bun:
name: Compile Bun apps
runs-on: ubuntu-latest
if: github.ref_name != 'main'
strategy:
matrix:
tool:
- uml2ts
target:
- bun-linux-x64
- bun-linux-arm64
- bun-darwin-x64
- bun-darwin-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- name: Restore dependencies
working-directory: packages/${{ matrix.tool }}
run: bun install --frozen-lockfile
- name: Build
run: |
bun build \
--compile \
--target ${{ matrix.target }} \
--minify \
--sourcemap ./packages/${{ matrix.tool }}/index.ts \
--outfile ${{ matrix.tool }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tool }}_${{ matrix.target }}
path: ${{ matrix.tool }}
goreleaser:
name: Run GoReleaser
runs-on: ubuntu-latest
if: github.ref_name != 'main'
needs: bun
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download
uses: actions/download-artifact@v4
with:
pattern: '*'
path: ${{ github.workspace }}/bin
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.work
cache-dependency-path: go.work.sum
- name: GoReleaser Dry-run
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Disable the monorepo feature
GORELEASER_CURRENT_TAG: v0.0.1
GORELEASER_PREVIOUS_TAG: v0.0.1-alpha
- name: Run GoReleaser
if: github.event_name != 'pull_request'
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}