Skip to content

Commit 1c08ee0

Browse files
authored
chore: align GitHub Actions with other projectwallace repositories (#147)
* chore: align GitHub Actions with other projectwallace repositories * update projectwallace deps * update deps
1 parent aa185a0 commit 1c08ee0

5 files changed

Lines changed: 678 additions & 676 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
version: 2
55
updates:
6-
- package-ecosystem: 'npm' # pnpm is detected automatically via pnpm-lock.yaml
6+
- package-ecosystem: 'npm'
77
directory: '/'
88
schedule:
99
interval: 'monthly'
@@ -16,6 +16,8 @@ updates:
1616
- '*'
1717
exclude-patterns:
1818
- '@projectwallace/*'
19+
cooldown:
20+
default-days: 7
1921
- package-ecosystem: 'github-actions'
2022
directory: '/'
2123
schedule:
@@ -24,3 +26,5 @@ updates:
2426
github-actions:
2527
patterns:
2628
- '*'
29+
cooldown:
30+
default-days: 7

‎.github/workflows/release.yml‎

Lines changed: 74 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,92 @@ on:
44
release:
55
types: [created]
66

7-
permissions:
8-
id-token: write # Required for OIDC provenance attestations
9-
contents: write # Required to push version bump commit
7+
permissions: {}
108

119
jobs:
12-
publish-npm:
10+
test:
1311
runs-on: ubuntu-latest
12+
permissions: {}
1413
steps:
15-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
16-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
17-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
14+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
15+
with:
16+
persist-credentials: false
17+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
18+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
19+
with:
20+
node-version: 24
21+
package-manager-cache: false
22+
- run: pnpm install --frozen-lockfile
23+
- run: pnpm test
24+
25+
build:
26+
needs: test
27+
runs-on: ubuntu-latest
28+
permissions: {}
29+
steps:
30+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
31+
with:
32+
persist-credentials: false
33+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
34+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
1835
with:
1936
node-version: 24
20-
registry-url: https://registry.npmjs.org
37+
package-manager-cache: false
2138
- run: pnpm install --frozen-lockfile
22-
- run: pnpm exec playwright install chromium --only-shell
23-
- run: pnpm test --forbid-only
2439
- run: pnpm run build
25-
- name: Bump version in package.json
26-
env:
27-
TAG_NAME: ${{ github.event.release.tag_name }}
28-
run: pnpm version "${TAG_NAME#v}" --no-git-tag-version
40+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
41+
with:
42+
name: dist
43+
path: dist/
44+
45+
bump-version:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write
50+
steps:
51+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
52+
with:
53+
persist-credentials: true
54+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
55+
- run: |
56+
VERSION=${GITHUB_REF_NAME#v}
57+
pnpm version $VERSION --no-git-tag-version
2958
- name: Commit and push version bump
3059
env:
31-
TAG_NAME: ${{ github.event.release.tag_name }}
32-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
60+
DEFAULT_BRANCH: main
3361
run: |
3462
git config user.name "github-actions[bot]"
3563
git config user.email "github-actions[bot]@users.noreply.github.com"
3664
git add package.json pnpm-lock.yaml
37-
git commit -m "chore: bump version to ${TAG_NAME}"
38-
git push origin HEAD:${DEFAULT_BRANCH}
65+
git commit -m "chore: bump version to ${GITHUB_REF_NAME#v}"
66+
git push origin HEAD:$DEFAULT_BRANCH
67+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
68+
with:
69+
name: package-json
70+
path: package.json
71+
72+
publish:
73+
needs: bump-version
74+
runs-on: ubuntu-latest
75+
permissions:
76+
id-token: write # Required for OIDC provenance
77+
steps:
78+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
79+
with:
80+
persist-credentials: false
81+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
82+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
83+
with:
84+
node-version: 24
85+
package-manager-cache: false
86+
registry-url: 'https://registry.npmjs.org'
87+
- run: pnpm install --frozen-lockfile
88+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
89+
with:
90+
name: dist
91+
path: dist/
92+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
93+
with:
94+
name: package-json
3995
- run: pnpm publish --no-git-checks

‎.github/workflows/test.yml‎

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Tests
22

33
on:
44
push:
@@ -14,79 +14,84 @@ jobs:
1414
name: Unit tests
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
17+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1818
with:
1919
persist-credentials: false
20-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
20+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
2121
- name: Use Node.js
22-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
22+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
2323
with:
24+
cache: 'pnpm'
2425
node-version: 24
25-
cache: pnpm
2626
- run: pnpm install --frozen-lockfile
2727
- name: Install Playwright Browsers
2828
run: pnpm exec playwright install chromium --only-shell
2929
- run: pnpm test --forbid-only
3030

31-
check-ts:
31+
check:
3232
name: Check types
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
35+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3636
with:
3737
persist-credentials: false
38-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
38+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
3939
- name: Use Node.js
40-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
40+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
4141
with:
42+
cache: 'pnpm'
4243
node-version: 24
43-
cache: pnpm
4444
- run: pnpm install --frozen-lockfile
4545
- run: pnpm run check
4646

47-
lint-code:
48-
name: Lint code (oxlint)
47+
build:
48+
name: Build
4949
runs-on: ubuntu-latest
5050
steps:
51-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
51+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5252
with:
5353
persist-credentials: false
54-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
54+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
5555
- name: Use Node.js
56-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
56+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
5757
with:
58+
cache: 'pnpm'
5859
node-version: 24
59-
cache: pnpm
6060
- run: pnpm install --frozen-lockfile
61-
- run: pnpm run lint
61+
- run: pnpm run build
6262

63-
declutter-code:
64-
name: Declutter code (Knip)
63+
lint:
64+
name: Lint
6565
runs-on: ubuntu-latest
6666
steps:
67-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
67+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6868
with:
6969
persist-credentials: false
70-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
70+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
7171
- name: Use Node.js
72-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
72+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
7373
with:
74+
cache: 'pnpm'
7475
node-version: 24
75-
cache: pnpm
7676
- run: pnpm install --frozen-lockfile
77-
- run: pnpm run knip
77+
- run: pnpm run lint
7878

79-
audit:
79+
npm-audit:
8080
name: Audit packages
8181
runs-on: ubuntu-latest
8282
steps:
83-
- name: Checkout code
84-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
85-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
86-
- name: Use Node.js
87-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
83+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8884
with:
89-
node-version: 24
90-
cache: pnpm
91-
- run: pnpm install --frozen-lockfile
85+
persist-credentials: false
86+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
9287
- run: pnpm audit --audit-level=high
88+
89+
knip:
90+
name: Lint unused code
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
94+
with:
95+
persist-credentials: false
96+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
97+
- run: pnpm run knip

‎package.json‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@
4545
"knip": "knip"
4646
},
4747
"dependencies": {
48-
"@projectwallace/css-parser": "~0.17.0",
49-
"@projectwallace/format-css": "^3.1.5"
48+
"@projectwallace/css-parser": "~0.18.1",
49+
"@projectwallace/format-css": "^3.1.6"
5050
},
5151
"devDependencies": {
52-
"@playwright/test": "^1.61.1",
52+
"@playwright/test": "^1.62.1",
5353
"@projectwallace/preset-oxlint": "^0.0.11",
54-
"@types/node": "^26.1.1",
54+
"@types/node": "^26.1.2",
5555
"c8": "^12.0.0",
56-
"knip": "^6.27.0",
57-
"oxfmt": "^0.59.0",
58-
"oxlint": "^1.74.0",
59-
"publint": "^0.3.21",
60-
"tsdown": "^0.22.11",
56+
"knip": "^6.31.0",
57+
"oxfmt": "^0.61.0",
58+
"oxlint": "^1.76.0",
59+
"publint": "^0.3.22",
60+
"tsdown": "^0.22.14",
6161
"typescript": "^7.0.2"
6262
},
6363
"overrides": {

0 commit comments

Comments
 (0)