Skip to content

Commit a34be95

Browse files
authored
Merge pull request #18 from thedadams/add-publish-workflow
chore: add publish workflow based on tag
2 parents 0b26ac9 + baddb88 commit a34be95

File tree

5 files changed

+30
-28
lines changed

5 files changed

+30
-28
lines changed

.github/workflows/release.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 1
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 21
18+
- name: Set package version
19+
run: |
20+
sed -i 's/ "version": "%VERSION%",/ "version": "${{ github.ref_name }}",/' package.json
21+
- name : Install dependencies
22+
run: npm install
23+
- name: Publish release
24+
run: npm run build && npm publish --access public
25+
env:
26+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v4
4242
with:
4343
fetch-depth: 1
44-
ref: ${{ github.event.pull_request.head.sha }}
44+
ref: ${{ github.event.pull_request.head.sha }}
4545
- uses: actions/setup-node@v4
4646
with:
4747
node-version: 21

Makefile

-24
This file was deleted.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gptscript-ai/gptscript",
3-
"version": "0.5.0",
3+
"version": "%VERSION%",
44
"description": "Run gptscript in node.js",
55
"main": "lib/gptscript.js",
66
"repository": {

0 commit comments

Comments
 (0)