Skip to content

Commit 843c7f9

Browse files
committed
prep for alpha
1 parent c22d6c9 commit 843c7f9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: Publish Package
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
6+
workflow_dispatch:
7+
push:
8+
tags:
9+
- 'v*'
610

711
jobs:
812
build:
@@ -32,6 +36,14 @@ jobs:
3236

3337
- name: Publish to NPM
3438
working-directory: ./package
35-
run: npm publish
39+
run: |
40+
VER=$(node -p "require('./package.json').version")
41+
if echo "$VER" | grep -q '-'; then
42+
echo "Detected prerelease version $VER -> publishing with tag 'next'"
43+
npm publish --tag next --access public
44+
else
45+
echo "Publishing stable version $VER"
46+
npm publish --access public
47+
fi
3648
env:
3749
NODE_AUTH_TOKEN: ${{ secrets.SHNIPPET_NPM_TOKEN }}

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "shnippet",
33
"type": "module",
4-
"version": "0.1.1-alpha.0",
4+
"version": "1.0.0-alpha.0",
55
"description": "A snippet extraction tool for various programming languages.",
66
"main": "./dist/index.cjs",
77
"module": "./dist/index.js",

0 commit comments

Comments
 (0)