-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (61 loc) · 1.75 KB
/
ci.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
60
61
62
63
name: CI
on:
schedule:
- cron: "0 0 * * 1" # Every Monday at 00:00 UTC
workflow_dispatch:
inputs:
publishExperimental:
description: 'Publish an experimental release'
required: false
type: boolean
default: false
push:
branches:
- main
paths-ignore:
- '**/**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: node_modules-
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn --cwd ./e2e install --frozen-lockfile
- run: yarn --cwd ./e2e test
- uses: actions/upload-artifact@v2
if: ${{ inputs.publishExperimental }}
with:
name: build-output
path: dist
experimental-publish:
if: ${{ inputs.publishExperimental }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: build-output
path: dist
- uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
- run: yarn version --no-git-tag-version --new-version "0.0.0-experimental-$(echo $GITHUB_SHA | cut -c1-9)"
- run: yarn pack --filename package.tgz
- run: yarn publish package.tgz --tag experimental --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: actions/upload-artifact@v2
with:
name: experimental-package
path: package.tgz