-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (55 loc) · 2.11 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
64
65
66
name: Continuous Integration
on:
pull_request:
branches: ["*"]
push:
branches: ["*"]
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: "Install node & npm"
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: "Install repository dependencies"
run: npm ci
- name: "Check code style"
run: find . -type f \( -iname \*.js -o -iname \*.jsx -o -iname \*.ts -o -iname \*.tsx \) | grep -v node_modules | grep -v /dist/ | xargs ./node_modules/.bin/prettier --check
# Note: we put other steps between the 'npm start' and the test runs, just to make time for the server to spin-up.
- name: "Tests"
run: npm run test:unit
- name: "Publish"
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically generated by GitHub / is not in our secrets.
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NODE_OPTIONS: --openssl-legacy-provider
working-directory: ./projects/bytescale-upload-widget-angular
run: |
npm set //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
npm run publish:executeIfReleaseCommit
- name: "Notification on success"
if: github.ref == 'refs/heads/main'
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: deployments
SLACK_COLOR: "#17BB5E"
SLACK_TITLE: "Built: @bytescale/upload-widget-angular :rocket:"
SLACK_FOOTER: "This package was successfully built."
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: "Notification on failure"
if: github.ref == 'refs/heads/main' && failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: deployments
SLACK_COLOR: "#BB1717"
SLACK_TITLE: "Failed: @bytescale/upload-widget-angular :boom:"
SLACK_FOOTER: "No packages published."
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}