Skip to content

Commit 518c1a0

Browse files
committed
publish
1 parent f89c5a6 commit 518c1a0

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

.github/workflows/publish.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: typescript
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- "cli/**"
8+
- "sdk/**"
9+
10+
jobs:
11+
publish-cli:
12+
runs-on: ubuntu-latest
13+
if: github.ref == 'refs/heads/main'
14+
defaults:
15+
run:
16+
working-directory: ./cli
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Install pnpm
24+
run: npm install -g pnpm@8
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: "20.x"
29+
registry-url: "https://registry.npmjs.org"
30+
31+
- name: Get pnpm store directory
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
35+
36+
- name: Setup pnpm cache
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ env.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
46+
run: pnpm install
47+
48+
- name: Build and Publish SDK
49+
run: |
50+
VERSION=$(jq '.version' package.json)
51+
CURRENT_NPM_VERSION=$(pnpm view @hatchet-dev/typescript-sdk version)
52+
53+
if [[ "$VERSION" == "$CURRENT_NPM_VERSION" ]]; then
54+
echo "Version has not changed. Skipping publish."
55+
exit 0
56+
fi
57+
58+
## If the version contains `alpha`, it's an alpha version
59+
## and we should tag it as such.=
60+
if [[ "$VERSION" == *alpha* ]]; then
61+
pnpm publish:ci:alpha
62+
else
63+
pnpm publish:ci
64+
fi
65+
env:
66+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ When building with Pickaxe, you are expected to:
3030
Getting started is as easy as two commands:
3131

3232
```
33-
pnpm i -g @hatchet-dev/pickaxe
33+
pnpm i -g @hatchet-dev/pickaxe-cli
3434
pickaxe create
3535
```
3636

cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "pickaxe",
3-
"version": "1.0.0",
2+
"name": "@hatchet-dev/pickaxe-cli",
3+
"version": "0.0.2",
44
"main": "dist/index.js",
55
"bin": {
66
"pickaxe": "./dist/index.js"

sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hatchet-dev/pickaxe",
3-
"version": "0.0.0",
3+
"version": "0.0.2",
44
"description": "Pickaxe SDK for Hatchet",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -26,4 +26,4 @@
2626
"ts-jest": "^29.1.2",
2727
"typescript": "^5.3.3"
2828
}
29-
}
29+
}

0 commit comments

Comments
 (0)