-
Notifications
You must be signed in to change notification settings - Fork 33
40 lines (30 loc) · 999 Bytes
/
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
name: Publish npm package
on:
push:
paths-ignore:
- 'README.md'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- run: npm ci
# - run: npm test
- name: Get package main version
id: package-version
uses: martinbeentjes/[email protected]
- name: Generate release version
run: |
echo "RELEASE_VERSION=${{ steps.package-version.outputs.current-version }}-prerelease.$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Set package version
run: npm --no-git-tag-version version $RELEASE_VERSION
- name: Tag release
run: |
git tag $RELEASE_VERSION
git push https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY $RELEASE_VERSION
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}