-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (48 loc) · 1.89 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
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish to npm registry
on:
workflow_dispatch:
inputs:
release-type:
description: 'Release type (one of): patch, minor, major'
required: true
type: choice
default: 'patch'
options:
- patch
- minor
- major
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: https://registry.npmjs.org/
scope: '@devexperts'
- name: Git Configuration
run: |
git config user.email "[email protected]"
git config user.name "dxpm"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Bump version
run: |
echo "NEW_TAG=$(npm --no-git-tag-version version $RELEASE_TYPE)" >> $GITHUB_ENV
env:
RELEASE_TYPE: ${{ github.event.inputs.release-type }}
- name: Commit changes
run: |
git commit -a -m "ci: release ${{ env.NEW_TAG }}"
- name: Create new tag
run: |
git tag ${{ env.NEW_TAG }}
# - name: Publish
# run: npm publish --access public
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPMJS_DEVEXPERTS_BOT_PUBLISH_TOKEN}}
- name: Push changes to repository
run: |
git push https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git ${{ github.ref }}
git push https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git --tags