Skip to content

Commit e48846a

Browse files
authored
Publish workflow (#14)
* release with tag v0.0.1 alpha * adding manual run option * lint * run tests in publish workflow * package version to 1.0.1
1 parent 8990785 commit e48846a

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
1+
name: Release
2+
13
on:
24
push:
35
tags:
46
- 'v*'
57
workflow_dispatch:
6-
name: release-please
8+
inputs:
9+
tag:
10+
description: 'Tag to release (e.g. v0.0.0-test)'
11+
required: true
12+
713
permissions:
814
contents: write
9-
pull-requests: write
1015
id-token: write
16+
1117
jobs:
12-
release-please:
18+
test:
19+
uses: ./.github/workflows/tests.yml
20+
secrets: inherit
21+
22+
publish:
1323
runs-on: ubuntu-latest
14-
steps:
15-
- uses: google-github-actions/release-please-action@v3
16-
id: release
17-
with:
18-
release-type: node
19-
package-name: mysql2
20-
changelog-path: 'Changelog.md'
24+
needs: test
2125

26+
steps:
2227
- uses: actions/checkout@v4
23-
if: ${{ steps.release.outputs.release_created }}
28+
29+
- name: Ensure tag exists (manual run)
30+
if: github.event_name == 'workflow_dispatch'
31+
run: |
32+
git tag ${{ inputs.tag }}
33+
git push origin ${{ inputs.tag }}
2434
2535
- uses: actions/setup-node@v4
26-
if: ${{ steps.release.outputs.release_created }}
2736
with:
2837
node-version: 22
2938
registry-url: 'https://registry.npmjs.org'
3039

31-
- name: Cache dependencies
32-
uses: actions/cache@v4
33-
with:
34-
path: ~/.npm
35-
key: npm-linux-${{ hashFiles('package-lock.json') }}
36-
restore-keys: npm-linux-
37-
3840
- run: npm ci
39-
if: ${{ steps.release.outputs.release_created }}
4041

41-
- run: npm publish --provenance
42-
if: ${{ steps.release.outputs.release_created }}
42+
- name: Create GitHub Release
43+
uses: softprops/action-gh-release@v1
44+
with:
45+
tag_name: ${{ inputs.tag || github.ref_name }}
46+
generate_release_notes: true
47+
48+
- run: npm publish --provenance --access public
4349
env:
44-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "singlestore-nodejs",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Fast SingleStore driver for Node.js. Implements core protocol, prepared statements, SSL and compression in native JS",
55
"main": "index.js",
66
"typings": "typings/mysql/index",

0 commit comments

Comments
 (0)