Skip to content

Commit 38c8f8e

Browse files
committed
Final prep
1 parent d6cefb6 commit 38c8f8e

File tree

6 files changed

+320
-20
lines changed

6 files changed

+320
-20
lines changed

.github/workflows/npm-publish.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
name: Publish to npm
1+
name: Publish "get-started" to npm
22

33
on:
44
push:
55
branches:
66
- 'main'
77
paths:
88
- 'examples/get-started/**'
9-
# TODO: Remove after testing
10-
pull_request:
11-
branches:
12-
- '*'
13-
paths:
14-
- 'examples/get-started/**'
159

1610
jobs:
11+
check_version:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
version_changed: ${{ steps.check_version.outputs.changed }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 2
19+
- name: Check if version has changed
20+
id: check_version
21+
run: |
22+
git diff HEAD^ HEAD -- examples/get-started/package.json | grep '"version"' && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT
23+
1724
publish:
25+
needs: check_version
26+
if: needs.check_version.outputs.version_changed == 'true'
1827
runs-on: ubuntu-latest
1928
steps:
2029
- uses: actions/checkout@v2
@@ -28,7 +37,6 @@ jobs:
2837

2938
# Only install dev dependencies, for the binary. No need to install deps for the source code.
3039
- name: Install dependencies
31-
# Weird tsup quirk https://github.com/npm/cli/issues/4828#issuecomment-2404560937
3240
run: pnpm install --dev
3341
working-directory: ./examples/get-started
3442

@@ -37,8 +45,7 @@ jobs:
3745
working-directory: ./examples/get-started
3846

3947
- name: Publish to npm
40-
# --no-git-checks is needed because "rollup-linux-x64-gnu" is out sync
41-
run: pnpm publish --access public --no-git-checks
48+
run: pnpm publish --access public
4249
working-directory: ./examples/get-started
4350
env:
4451
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

examples/get-started/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
dist
3+
.env
4+
.env*
5+
.npmrc
6+
tsconfig.tsbuildinfo
7+
.DS_Store

examples/get-started/bin/get-started.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function main() {
3232

3333
if (projectName) {
3434
targetDir = path.join(currentDir, projectName);
35-
const filesToCopy = ['src', 'scheduleWorkflow.ts', 'tsconfig.json'];
35+
const filesToCopy = ['src', 'scheduleWorkflow.ts', 'tsconfig.json', '.gitignore'];
3636
filesToCopy.forEach(file => {
3737
fs.cpSync(path.join(packageRoot, file), path.join(targetDir, file), { recursive: true });
3838
});

examples/get-started/package-lock.json

Lines changed: 168 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/get-started/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"license": "MIT",
2121
"dependencies": {
2222
"@restackio/ai": "^0.0.75",
23+
"@restackio/integrations-openai": "^0.0.24",
2324
"@temporalio/workflow": "^1.11.2",
2425
"nodemon": "^2.0.22",
2526
"ts-node": "^10.9.2",
@@ -40,5 +41,4 @@
4041
"rollup": "npm:@rollup/wasm-node"
4142
}
4243
}
43-
4444
}

0 commit comments

Comments
 (0)