-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.47 KB
/
Copy pathci.yml
File metadata and controls
52 lines (48 loc) · 1.47 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 24
cache: "yarn"
- run: yarn install --immutable
- run: yarn lint
- run: yarn test
- run: yarn build
dry-run:
needs: quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 24
cache: "yarn"
- run: yarn install --immutable
- run: yarn build
- name: Check package publication status
id: package-status
shell: bash
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
PACKAGE_VERSION=$(node -p "require('./package.json').version")
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version >/dev/null 2>&1; then
echo "published=true" >> "$GITHUB_OUTPUT"
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} is already published; skipping publish dry-run."
else
echo "published=false" >> "$GITHUB_OUTPUT"
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} is not published; running publish dry-run."
fi
- name: Dry Run Publish
if: steps.package-status.outputs.published == 'false'
run: npm publish --dry-run