-
Notifications
You must be signed in to change notification settings - Fork 18
118 lines (110 loc) · 3.94 KB
/
Copy pathmain.yml
File metadata and controls
118 lines (110 loc) · 3.94 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: main
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0 # Need all tags to get a version number in-between tags
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build-demo
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: ./node_modules/.bin/ng test fab-speed-dial --progress false --watch=false --browsers ChromeHeadless
- run: ./node_modules/.bin/ng test demo --progress false --watch=false --browsers ChromeHeadless
- run: pnpm e2e
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm lint
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: ./node_modules/.bin/prettier --experimental-cli --check .
publish-demo:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- build
- test
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- uses: crazy-max/ghaction-github-pages@v5
with:
build_dir: dist/demo/browser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [build, test, lint, prettier]
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- run: rm .gitignore
# Publish to npm
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: pnpm publish --provenance --no-git-checks dist/fab-speed-dial/
# Create release
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
run: gh release create "$GITHUB_REF_NAME" --verify-tag --notes "$(git tag --format '%(contents:body)' --points-at)"