Skip to content

Commit d189768

Browse files
committed
release flow
1 parent a902ad0 commit d189768

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Release
22
on:
33
push:
4-
branches:
5-
- main
4+
tags:
5+
- 'v*.*.*'
6+
67
jobs:
78
build_wasm:
89
name: build for node.js
@@ -20,20 +21,19 @@ jobs:
2021
with:
2122
name: node_lua_with_lrdb
2223
path: node/bin/node_lua_with_lrdb.*
23-
release:
24+
25+
publish:
2426
needs: build_wasm
25-
name: Release
27+
name: Publish to NPM
2628
runs-on: ubuntu-latest
2729
steps:
2830
- name: Checkout
2931
uses: actions/checkout@v4
30-
with:
31-
fetch-depth: 0
32-
persist-credentials: false
3332
- name: Setup Node.js
3433
uses: actions/setup-node@v4
3534
with:
3635
node-version: 20
36+
registry-url: 'https://registry.npmjs.org'
3737
- name: Download a node_lua_with_lrdb
3838
uses: actions/download-artifact@v4
3939
with:
@@ -43,9 +43,34 @@ jobs:
4343
working-directory: node
4444
- run: npm run bundle
4545
working-directory: node
46-
- name: Release
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
49-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50-
run: npx semantic-release
46+
- name: Get version from tag
47+
id: get_version
48+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
49+
- name: Update package version
50+
run: npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version
51+
working-directory: node
52+
- name: Publish to NPM
53+
run: npm publish
5154
working-directory: node
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
58+
create_release:
59+
needs: publish
60+
name: Create GitHub Release
61+
runs-on: ubuntu-latest
62+
permissions:
63+
contents: write
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
- name: Download artifacts
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: node_lua_with_lrdb
71+
path: artifacts/
72+
- name: Create Release
73+
uses: softprops/action-gh-release@v1
74+
with:
75+
files: artifacts/*
76+
generate_release_notes: true

node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lrdb-debuggable-lua",
3-
"version": "0.6.0",
3+
"version": "0.6.0-dev",
44
"main": "dist/index",
55
"license": "MIT",
66
"scripts": {

0 commit comments

Comments
 (0)