-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (79 loc) · 3.08 KB
/
__shared-ci.yml
File metadata and controls
90 lines (79 loc) · 3.08 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
name: Common Continuous Integration tasks
on:
workflow_call:
outputs:
build-artifact-id:
description: "The artifact ID of the build output"
value: ${{ jobs.nodejs.outputs.build-artifact-id }}
package-tarball-artifact-id:
description: "The artifact ID of the uploaded package tarball"
value: ${{ jobs.package-theme.outputs.package-tarball-artifact-id }}
permissions: {}
jobs:
linter:
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@b17226e57c8ef31f860719766656ebb6df017218 # 0.31.6
permissions:
actions: read
contents: read
security-events: write
statuses: write
with:
linter-env: |
FILTER_REGEX_EXCLUDE=packages/theme/lib/**/*,packages/docs/build/**/*
VALIDATE_TYPESCRIPT_ES=false
VALIDATE_JAVASCRIPT_ES=false
VALIDATE_TSX=false
VALIDATE_CSS=false
nodejs:
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@c9d9d041ba4ef35695ee469c4782fa6a8bbebbcc # 0.21.2
permissions:
contents: read
id-token: write
packages: read
pull-requests: write
security-events: write
with:
build: |
{
"artifact": ["packages/theme/lib", "packages/docs/build"]
}
package-theme:
name: Package and verify Docusaurus theme
needs: [linter, nodejs]
runs-on: ubuntu-latest
outputs:
package-tarball-artifact-id: ${{ steps.upload-package-tarball.outputs.artifact-id }}
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup Node.js
uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@c9d9d041ba4ef35695ee469c4782fa6a8bbebbcc # 0.21.2
- name: Download build artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
artifact-ids: ${{ needs.nodejs.outputs.build-artifact-id }}
path: /
- name: Create package tarball
working-directory: packages/theme
run: |
# When running for tags, update package.json version to match tag name
if [ "${{ github.ref_type }}" == "tag" ] && [ -n "${{ github.ref_name }}" ]; then
echo "Updating package version to match tag name: ${{ github.ref_name }}"
npm version "${{ github.ref_name }}" --no-git-tag-version --no-workspaces-update
fi
npm pack --pack-destination ${{ runner.temp }}/
- name: Install package in the docs package to verify
working-directory: packages/docs
run: |
npm uninstall @hoverkraft/docusaurus-theme || true
npm install ${{ runner.temp }}/hoverkraft-docusaurus-theme-*.tgz
npm run build
- name: Upload package tarball
id: upload-package-tarball
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: package-tarball
path: ${{ runner.temp }}/hoverkraft-docusaurus-theme-*.tgz