forked from react-csv/react-csv
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (50 loc) · 1.75 KB
/
release.yaml
File metadata and controls
51 lines (50 loc) · 1.75 KB
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
on:
push:
tags:
- "v*"
jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
NPM_TOKEN: ""
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}
# install Node.js
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- run: npm install # ci --prefer-offline
# upgrade npm version in package.json to the tag used in the release.
# omit the "v" letter of "v1.2.3"
- run: npm version $(git describe --tags | sed 's/v//g') --no-git-tag-version
# npm version $(echo $GTAG | sed 's/v//g')
# env:
# GTAG: ${{ github.event.release.tag_name }}
# set up git since we will later push to the repo
- name: Docs generating
run: npm run docgen
# publish to NPM -> there is one caveat, continue reading for the fix
# it will build and generate CDN
- run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
- run: npm publish
# --tag ${{ github.event.release.target_commitish }}
env:
# Use a token to publish to NPM. See below for how to set it up
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# push the version changes to GitHub
- run: |
git config --global user.name "React CSV Bot";
git config --global user.email "github@abdennoor.com";
- run: |
git add --all
git commit -am "release: 🚚 $(git describe --tags | sed 's/v//g')"
git push origin HEAD:master
env:
# The secret is passed automatically. Nothing to configure.
github-token: ${{ secrets.GITHUB_TOKEN }}