-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (43 loc) · 1.32 KB
/
npm-publish.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
42
43
44
45
# This workflow will run tests using node and then publish a package to NPM when a tag is pushed
name: Publish wrapito-vitest to npm
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-beta*'
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm version --no-git-tag-version ${GITHUB_REF##*/}
- name: Publish package
run: |
if [[ ${{ github.ref }} == *-beta* ]]; then
npm run publish-package:beta
else
npm run publish-package
fi
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{steps.github_release.outputs.changelog}}
draft: false
prerelease: ${{ contains(github.ref, '-beta') }}