Skip to content

Commit 73d88ec

Browse files
committed
publish workflow
1 parent ef12ef9 commit 73d88ec

File tree

2 files changed

+61
-2
lines changed

2 files changed

+61
-2
lines changed

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Packages to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Run on any tag that starts with v (e.g., v1.0.0)
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '18'
19+
registry-url: 'https://registry.npmjs.org/'
20+
scope: '@beekeeperstudio'
21+
22+
- name: Get tag version
23+
id: get_version
24+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Update package version
30+
run: |
31+
yarn version --new-version $VERSION --no-git-tag-version
32+
33+
- name: Build packages
34+
run: yarn build
35+
36+
- name: Publish package
37+
run: yarn publish --access public --non-interactive
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
41+
# Create GitHub release for this version
42+
- name: Create GitHub Release
43+
uses: softprops/action-gh-release@v1
44+
with:
45+
name: Release ${{ env.VERSION }}
46+
body: |
47+
# Beekeeper Studio Plugin v${{ env.VERSION }}
48+
49+
Published package:
50+
- @beekeeperstudio/plugin@${{ env.VERSION }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@
66
"types": "dist/index.d.ts",
77
"files": [
88
"dist/*.js",
9-
"dist/*.d.ts"
9+
"dist/*.d.ts",
10+
"dist/*.js.map",
11+
"README.md",
12+
"LICENSE"
1013
],
1114
"scripts": {
1215
"build": "rollup -c",
13-
"prepublishOnly": "yarn run build"
16+
"prepublishOnly": "yarn run build",
17+
"clean": "rm -rf dist"
18+
},
19+
"publishConfig": {
20+
"access": "public"
1421
},
1522
"repository": {
1623
"type": "git",

0 commit comments

Comments
 (0)