-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (52 loc) · 1.42 KB
/
release.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
name: releasing
on:
push:
branches:
- release/major
- release/minor
- release/patch
- release/premajor
- release/preminor
- release/prepatch
- release/prerelease
jobs:
releasing:
name: releasing
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Set git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Versioning
run: npm version "${GITHUB_REF##*/}"
- name: Publish to npm
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push updates
run: |
git push origin ${{ github.ref_name }}
git push origin --tags
- name: Create Pull Request
run: >
gh pr create
--base "${{ github.event.repository.default_branch }}"
--body ''
--head "${{ github.ref_name }}"
--title "chore(release): publish"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}