-
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@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
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@e96599d869b66887c4c9dc18dd40b59249ad9cd0 # 0.20.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@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Setup Node.js
uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@e96599d869b66887c4c9dc18dd40b59249ad9cd0 # 0.20.2
- name: Download build artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: package-tarball
path: ${{ runner.temp }}/hoverkraft-docusaurus-theme-*.tgz