-
Notifications
You must be signed in to change notification settings - Fork 142
135 lines (133 loc) · 4.74 KB
/
ci.yaml
File metadata and controls
135 lines (133 loc) · 4.74 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: ci
on:
push:
branches:
- main
workflow_dispatch:
inputs:
skip_build_docs:
description: "Skip build docs"
type: boolean
default: false
skip_build_lib:
description: "Skip build lib"
type: boolean
default: false
skip_deploy_docs:
description: "Skip deploy docs"
type: boolean
default: false
skip_deploy_lib_ci:
description: "Skip deploy lib (CI)"
type: boolean
default: false
skip_deploy_lib_release:
description: "Skip deploy lib (release)"
type: boolean
default: false
skip_qa_coveralls:
description: "Skip QA Coveralls"
type: boolean
default: false
skip_qa_sonarqube:
description: "Skip QA SonarQube"
type: boolean
default: false
skip_release:
description: "Skip release"
type: boolean
default: true
skip_test:
description: "Skip test"
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
outputs:
new_gas_version: ${{ steps.push-gas.outputs.new_gas_version }}
pages_version: main # Simplified, as release-please handles versioning
do_push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
environment:
name: main
env:
CLASP_ACCESS_TOKEN: ${{secrets.CLASP_ACCESS_TOKEN}}
CLASP_CLIENT_ID: ${{secrets.CLASP_CLIENT_ID}}
CLASP_CLIENT_SECRET: ${{secrets.CLASP_CLIENT_SECRET}}
CLASP_EXAMPLES_DEPLOYMENT_ID: ${{secrets.CLASP_EXAMPLES_DEPLOYMENT_ID}}
CLASP_EXAMPLES_SCRIPT_ID: ${{secrets.CLASP_EXAMPLES_SCRIPT_ID}}
CLASP_ID_TOKEN: ${{secrets.CLASP_ID_TOKEN}}
CLASP_LIB_DEPLOYMENT_ID: ${{secrets.CLASP_LIB_DEPLOYMENT_ID}}
CLASP_LIB_SCRIPT_ID: ${{secrets.CLASP_LIB_SCRIPT_ID}}
CLASP_REFRESH_TOKEN: ${{secrets.CLASP_REFRESH_TOKEN}}
GCLOUD_PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
GCLOUD_PROJECT_NR: ${{secrets.GCLOUD_PROJECT_NR}}
steps:
- id: release
name: Release
if: ${{ !github.event.inputs.skip_release }}
uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4
with:
release-type: node
- id: checkout
name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- id: setup-nodejs
name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.x
cache: "npm"
- id: build-lib
if: ${{ !github.event.inputs.skip_build_lib }}
name: Build lib
run: npm run ci:build
- id: test
if: ${{ !github.event.inputs.skip_test }}
name: Test
run: npm run ci:test
- id: build-docs
if: ${{ !github.event.inputs.skip_build_docs }}
name: Build docs
run: npm run ci:docs
- id: qa-coveralls
if: ${{ !github.event.inputs.skip_qa_coveralls }}
name: QA Coveralls
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
- id: qa-sonarqube
if: ${{ !github.event.inputs.skip_qa_sonarqube }}
name: QA SonarQube
uses: SonarSource/sonarqube-scan-action@2500896589ef8f7247069a56136f8dc177c27ccf # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- id: deploy-lib-ci
if: ${{ !github.event.inputs.skip_deploy_lib_ci }}
name: Deploy Lib (CI)
run: |
npm run push
echo "new_gas_version=$(cat build/gas/lib-version.txt)" >> "${GITHUB_OUTPUT}"
- id: deploy-lib-release
if: ${{ !github.event.inputs.skip_deploy_lib_release && !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created
name: Deploy Lib (Release)
run: npm run deploy
env:
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }}
- id: update-release-notes
if: ${{ !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created
name: Update Release Notes
run: |
npm run release:update
env:
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: deploy-docs
if: ${{ !github.event.inputs.skip_deploy_docs }}
name: Deploy docs
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4
with:
folder: docs/build