-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 954 Bytes
/
Copy pathbuild.yml
File metadata and controls
37 lines (35 loc) · 954 Bytes
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
name: Build and deploy
on:
push:
paths:
- 'package.json'
pull_request:
paths:
- 'package.json'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Build
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@main
- name: Install Closure Compiler
run: npm install --no-save google-closure-compiler
- name: Build
run: npm run build
- name: Publish to npm
if: github.ref == 'refs/heads/main'
uses: JS-DevTools/npm-publish@main
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Add git tag
if: github.ref == 'refs/heads/main'
run: |
VERSION=$(node -p "require('./package.json').version")
git config user.name github-actions
git config user.email github-actions@github.com
git tag -f "v$VERSION"
git push -f origin "v$VERSION"