Skip to content

Commit ef479da

Browse files
committed
WIP
1 parent 4492cd8 commit ef479da

1 file changed

Lines changed: 68 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,34 @@ name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
# TEMPORARY FOR TESTING ON FORK ONLY.
6+
# tags:
7+
# - 'v*'
8+
pull_request:
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
inputs:
13+
dry-run:
14+
description: Validate build and npm publish without uploading
15+
type: boolean
16+
default: true
717

818
permissions:
919
contents: write
20+
id-token: write
21+
22+
env:
23+
DRY_RUN: ${{ !(startsWith(github.ref, 'refs/tags/') || inputs.dry-run == 'false') }}
1024

1125
jobs:
1226
build:
1327
runs-on: ubuntu-latest
1428

1529
steps:
16-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1731

18-
- uses: oven-sh/setup-bun@v2
32+
- uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
1933
with:
2034
bun-version: latest
2135

@@ -50,7 +64,7 @@ jobs:
5064
sha256sum plannotator-win32-x64.exe > plannotator-win32-x64.exe.sha256
5165
5266
- name: Upload artifacts
53-
uses: actions/upload-artifact@v4
67+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5468
with:
5569
name: binaries
5670
path: |
@@ -59,15 +73,16 @@ jobs:
5973
6074
release:
6175
needs: build
76+
if: startsWith(github.ref, 'refs/tags/')
6277
runs-on: ubuntu-latest
6378
permissions:
6479
contents: write
6580

6681
steps:
67-
- uses: actions/checkout@v4
82+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6883

6984
- name: Download artifacts
70-
uses: actions/download-artifact@v4
85+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
7186
with:
7287
name: binaries
7388
path: artifacts
@@ -76,9 +91,54 @@ jobs:
7691
run: ls -la artifacts/
7792

7893
- name: Create GitHub Release
79-
uses: softprops/action-gh-release@v2
94+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
8095
with:
8196
files: artifacts/*
8297
generate_release_notes: true
8398
draft: false
8499
prerelease: ${{ contains(github.ref, '-') }}
100+
101+
npm-publish:
102+
needs: build
103+
runs-on: ubuntu-latest
104+
permissions:
105+
contents: read
106+
id-token: write
107+
steps:
108+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
109+
110+
- uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
111+
with:
112+
bun-version: latest
113+
114+
- name: Install dependencies
115+
run: bun install
116+
117+
- name: Build packages
118+
run: |
119+
bun run build:review
120+
bun run build:hook
121+
bun run build:opencode
122+
bun run build:pi
123+
124+
- name: Publish @plannotator/opencode
125+
working-directory: apps/opencode-plugin
126+
env:
127+
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
128+
run: |
129+
if [[ "$DRY_RUN" == "true" ]]; then
130+
bun pm pack
131+
else
132+
bun publish --access public --provenance
133+
fi
134+
135+
- name: Publish @plannotator/pi-extension
136+
working-directory: apps/pi-extension
137+
env:
138+
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
139+
run: |
140+
if [[ "$DRY_RUN" == "true" ]]; then
141+
bun pm pack
142+
else
143+
bun publish --access public --provenance
144+
fi

0 commit comments

Comments
 (0)