-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (73 loc) · 2.77 KB
/
main.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
name: Build & Publish
on:
push:
tags:
- 'v*'
jobs:
install-and-build:
name: 🛠️ Install & Build
runs-on: ubuntu-latest
steps:
- name: 🗜️ Checkout
uses: actions/checkout@v4
- name: 🗜️ Setup node version
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- name: 🛠️ Install
uses: ./.github/actions/cached-deps
- name: 🛠️ Sync versions
run: yarn script:sync-projects
- name: 🧹 Lint
run: yarn lint
- name: 🧪 Run tests
run: yarn test:jest
- name: ⬆️ Upload coverage reports
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: false
dry_run: false
- name: 📦 Build demo app
run: yarn build:demo --base-href https://celtian.github.io/ngx-app-version/
- name: 📦 Build ngx-app-version
run: yarn build
- name: 🚀 Publish NPM
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: cd dist/ngx-app-version && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: 🚀 Publish NPM BETA
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == true
run: cd dist/ngx-app-version && npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: 🛠️ Set up package for GPR
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: yarn script:gpr-setup
- name: 🛠️ Use GPR
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://npm.pkg.github.com/
scope: '@celtian'
- name: 🚀 Publish to GitHub Package Registry
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: |
cd dist/ngx-app-version
npm publish
env:
NODE_AUTH_TOKEN: ${{github.token}}
- name: 🛠️ Copy index.html to 404.html
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: cp ./dist/demo/browser/index.html ./dist/demo/browser/404.html
- name: 🚀 Deploy Github Pages
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./dist/demo/browser