forked from mojir/lits
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.29 KB
/
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 Package to GitHub Packages
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
scope: '@${{ github.repository_owner }}'
- name: Bump version
run: npm version patch
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run tests
run: npm test
- name: Build
run: npm run build
# - name: Publish to GitHub Packages
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git config
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Commit version bump
run: |
git add .
git commit -m 'ci: bump version'
git push
- name: Create Git tag
run: |
TAG_NAME=$(npm pkg get version | tr -d '"')
git tag v$TAG_NAME
git push origin v$TAG_NAME