forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.21 KB
/
publish.yml
File metadata and controls
39 lines (39 loc) · 1.21 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
name: Publish
on:
schedule:
- cron: '0 0 * * *'
jobs:
release:
name: Packages
if: github.repository == 'AssemblyScript/assemblyscript'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: master
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: npm ci
- name: Build distribution files
run: |
npm run clean
npm run build
- name: Test distribution files
run: npm test
- name: Make semantic release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# On success, semantic-release will update the version and publish,
# triggering the postversion script that'll update the loader's version
# as well. If nothing was published, the version will still be '0.0.0'.
run: |
node node_modules/semantic-release/bin/semantic-release.js --unstable
cd lib/loader
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
npm publish --access public
fi
cd ../..