-
Notifications
You must be signed in to change notification settings - Fork 2.1k
58 lines (55 loc) · 1.72 KB
/
release-canary.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
name: MDC Release (Canary)
# This workflow creates a pre-release and publishes packages to NPM with canary
# tag on every commit to master.
on:
push:
branches:
- master
paths:
- "packages/**/*.ts"
- "packages/**/*.scss"
- "**/package*.json"
- "**/.npmignore"
jobs:
release-canary:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
- name: Fetch all tags
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
npm ci --ignore-scripts
npm run bootstrap
- name: Build packages
run: |
npm run dist
node scripts/cp-pkgs.js
node scripts/verify-pkg-main.js
- name: Create canary release
run: |
npx lerna version premajor --no-git-tag-version --no-push --preid canary.$(git rev-parse --short HEAD) --yes --exact
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "chore: Publish"
- name: Publish to NPM registry with canary tag
run: npx lerna publish from-package --yes --dist-tag canary
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}