Skip to content

Commit 1b50953

Browse files
committed
ci: test conditional running of xgo and release
1 parent 63ee55e commit 1b50953

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

.changeset/dull-taxis-do.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"blipgloss": patch
3+
---
4+
5+
Test conditional xgo workflow

.github/workflows/release.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,26 @@ jobs:
2020
with:
2121
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2222
fetch-depth: 0
23+
24+
- name: Setup Bun
25+
uses: oven-sh/setup-bun@v2
26+
with:
27+
bun-version: latest
28+
29+
- run: bun install
30+
31+
- name: Check for changesets
32+
id: check
33+
run: |
34+
if bunx changeset status --since=main --verbose | grep -q 'Packages to be bumped'; then
35+
echo "CHANGESETS_PENDING=true" >> $GITHUB_ENV
36+
else
37+
echo "CHANGESETS_PENDING=false" >> $GITHUB_ENV
38+
fi
39+
2340
- name: Build with xgo
2441
uses: crazy-max/ghaction-xgo@v3
25-
if: steps.changesets.outputs.published == 'true'
42+
if: env.CHANGESETS_PENDING == 'true'
2643
with:
2744
go_version: latest
2845
targets: windows/amd64,linux/amd64,linux/arm64,darwin/arm64
@@ -31,12 +48,6 @@ jobs:
3148
# Add other xgo flags as needed, e.g.:
3249
ldflags: -s -w
3350
buildmode: c-shared
34-
- name: Setup Bun
35-
uses: oven-sh/setup-bun@v2
36-
with:
37-
bun-version: latest
38-
39-
- run: bun install
4051

4152
- name: Create Release Pull Request or Publish to npm
4253
id: changesets

0 commit comments

Comments
 (0)