-
Notifications
You must be signed in to change notification settings - Fork 601
65 lines (51 loc) · 1.77 KB
/
cd-release-npm.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
64
65
name: Release NPM Packages
on:
workflow_dispatch:
# schedule:
# - cron: '0 7 * * 0-4'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SERVICE_USER: "Microsoft FAST Builds"
GITHUB_SERVICE_EMAIL: "[email protected]"
jobs:
build_linux:
runs-on: ubuntu-latest
if: contains('chrisdholt,janechu,nicholasrice,awentzel,eisenbergeffect', github.actor)
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 16.20.0
- name: Add or Update packages
run: sudo yarn global add [email protected]
- name: Set Git User
run: |
git config --global user.name "${{ env.GITHUB_SERVICE_USER }}"
git config --global user.email "${{ env.GITHUB_SERVICE_EMAIL }}"
- name: Install package dependencies / prepare workspaces
run: yarn install --frozen-lockfile
- name: Check for the presence of changed files inside ./change
run: yarn checkchange
- name: Testing Prettier format
run: lerna run prettier:diff
- name: Testing unit tests
run: lerna run test --stream
- name: Publish NPM packages
env:
NPM_SECRET_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish-ci -n $NPM_SECRET_TOKEN
notify:
runs-on: ubuntu-latest
needs: build_linux
steps:
- name: Notify on Discord
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_NOTIFICATION_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_NOTIFICATION_WEBHOOK_TOKEN }}
color: '#DE2D6D'
username: 'FAST DevOps Packages Bot'
message: 'Release has published to NPM on https://github.com/microsoft/fast/actions/workflows/cd-release-npm.yml'