-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.12 KB
/
npm_publish_dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Node.js Package Dev Release
on:
push:
branches-ignore:
- 'master'
jobs:
build-and-publish-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
- name: Get current version
id: package-version
uses: martinbeentjes/[email protected]
- name: Generate unique version
id: generate-version
run: |
current_version=$(echo ${{ steps.package-version.outputs.current-version}} | sed 's/-dev\.[0-9]\+$//')
timestamp=$(date +%Y%m%d%H%M%S)
echo "new_version=${current_version}-dev.${timestamp}" >> $GITHUB_OUTPUT
- name: Update version
run: npm version ${{ steps.generate-version.outputs.new_version }} --no-git-tag-version
- name: Publish to npm
run: npm publish --tag dev
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}