forked from canonical/vanilla-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.61 KB
/
publish-on-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
52
53
54
55
56
57
58
59
name: Publish Vanilla release
on:
release:
types: [published]
jobs:
build:
name: Build Vanilla
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Read Vanilla version from package.json
run: |
node -p "require('./package.json').version" > VANILLA_VERSION
echo "Building Vanilla v$(cat VANILLA_VERSION)"
- run: yarn install
- run: yarn build
- run: yarn test
- name: Show size of the build file
run: stat -c '%s' build/css/build.css
- run: cp VANILLA_VERSION build/css
- uses: actions/upload-artifact@v2
with:
name: css
path: build/css
publish-npm:
name: Publish to NPM
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-assets:
name: Publish to assets server
needs: [build, publish-npm]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: css
path: css
- name: Install upload-assets snap
run: sudo snap install upload-assets
- name: Upload to assets server
run: upload-assets --url-path vanilla-framework-version-$(cat css/VANILLA_VERSION).min.css css/build.css
env:
UPLOAD_ASSETS_API_TOKEN: ${{secrets.UPLOAD_ASSETS_API_TOKEN}}