File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ permissions :
8+ contents : read
9+
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+ cancel-in-progress : true
13+
14+ env :
15+ CI : true
16+ CACHE_PREFIX : stable
17+ NODE_VERSION : 16
18+
19+ jobs :
20+ build :
21+ runs-on : ubuntu-latest
22+
23+ steps :
24+ - uses : actions/checkout@v3
25+
26+ - name : Use Node.js ${{ env.NODE_VERSION }}
27+ uses : actions/setup-node@v3
28+ with :
29+ node-version : ${{ env.NODE_VERSION }}
30+ registry-url : " https://registry.npmjs.org"
31+
32+ - name : Use cached node_modules
33+ id : cache
34+ uses : actions/cache@v3
35+ with :
36+ path : node_modules
37+ key : ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ env.CACHE_PREFIX }}-node_modules-${{ hashFiles('**/package-lock.json') }}
38+
39+ - name : Install dependencies
40+ run : npm install
41+
42+ - name : Build Prettier Plugin
43+ run : |
44+ npm run build
45+
46+ - name : Test
47+ run : |
48+ npm run test
49+
50+ - name : Calculate environment variables
51+ run : |
52+ echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
53+
54+ - name : Publish
55+ run : npm publish --tag ${{ env.RELEASE_CHANNEL }}
56+ env :
57+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments