-
Notifications
You must be signed in to change notification settings - Fork 601
83 lines (67 loc) · 2.21 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
strategy:
matrix:
node: [20.x]
if: contains('chrisdholt,janechu', github.actor)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Set Git User
run: |
git config --global user.name "${{ env.GITHUB_SERVICE_USER }}"
git config --global user.email "${{ env.GITHUB_SERVICE_EMAIL }}"
- name: Cache multiple paths
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install package dependencies / prepare workspaces
run: npm ci
- name: Check for the presence of changed files inside ./change
run: npm run checkchange
- name: Testing Prettier format
run: npm run format:check
- name: Build workspaces
run: npm run build
- name: Install playwright dependencies and browsers
run: |
npx playwright install
- name: Testing unit tests
run: npm run test
- name: Testing final validation
run: npm run test:validation
- name: Publish NPM packages
env:
NPM_SECRET_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run publish-ci -- --token "$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'