generated from 47ng/typescript-library-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (93 loc) · 3.16 KB
/
ci-cd.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI/CD
on:
push:
pull_request:
types: [opened, edited, reopened, synchronize]
env:
FORCE_COLOR: 3 # Diplay chalk colors
jobs:
ci:
name: Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: 9
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: lts/*
cache: pnpm
# Generate local TLS certificates to test HTTPS support, using mkcert:
- name: Install dependencies
run: pnpm install
- name: Install & setup mkcert
run: |
sudo apt install libnss3-tools
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
echo "mkcert version: $(mkcert -version)"
mkcert -install
- name: Generate TLS certificates
run: pnpm mkcert
- name: Run integration tests
run: pnpm run ci
- uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949
name: Report code coverage
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: 47ng/actions-slack-notify@main
name: Notify on Slack
if: always()
with:
jobName: Integration
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
cd:
name: Deployment
runs-on: ubuntu-latest
needs: [ci]
if: ${{ github.ref_name == 'main' || github.ref_name == 'beta' || github.ref_name == 'alpha' }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: 9
run_install: |
- args: [--frozen-lockfile]
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 16.x
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile
- name: Build package
run: pnpm build
- name: Sign package
run: npx sceau sign
env:
SCEAU_BUILD_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
SCEAU_SOURCE_URL: https://github.com/${{github.repository}}/commit/${{ github.sha }}
SCEAU_PRIVATE_KEY: ${{ secrets.SCEAU_PRIVATE_KEY }}
- uses: docker://ghcr.io/codfish/semantic-release-action@sha256:16ab6c16b1bff6bebdbcc6cfc07dfafff49d23c6818490500b8edb3babfff29e
name: Semantic Release
id: semantic
with:
branches: |
[
'main',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}