-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.16 KB
/
main.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
name: Publish npm package
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Bump version and get tag
id: version_bump
uses: anothrNick/github-tag-action@1.13.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCHES: 'master,v2'
DEFAULT_BUMP: 'patch'
WITH_V: true
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@g-loot' # Defaults to the user or organization that owns the workflow file
# This gets the current tag (pre-release and real tags)
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$( git describe --tag --abbrev=0 )
- run: git describe --tag --abbrev=0
- run: npm --no-git-tag-version version $( git describe --tag --abbrev=0 )
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}