-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.64 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
name: Release and publish package to npm
on:
workflow_dispatch:
inputs:
release-version:
description: 'Release version to manually set & publish. E.g. 0.34.0'
required: true
# release:
# types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm
- name: bump release version
run: |
echo "NEW_VERSION=$(npm --no-git-tag-version version $RELEASE_VERSION)" >> $GITHUB_ENV
cat package.json
env:
RELEASE_VERSION: ${{ github.event.inputs.release-version }}
- name: print version
run: |
echo "VERSION=${{ env.NEW_VERSION }}"
- run: npm ci
- name: push changes to repository
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email [email protected]
git status
# touch test/test.txt
#echo "NEW_VERSION=${{ env.NEW_VERSION }}" >> test/test.txt
# git add test/test.txt
git add package.json
git commit -m "chore(version): ${{ env.NEW_VERSION }}"
git tag ${{ env.NEW_VERSION }}
git status
git push && git push --tags
echo git push origin && echo git push --tags
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}