Skip to content

Commit

Permalink
Fix/renovate config (#784)
Browse files Browse the repository at this point in the history
* ci(renovate): `@types/node`のバージョン制約を更新

* chore(build): wrangler.tomlにschemaを指定

* fix(ci): ツールチェーン同期のワークフローを修正

* fix(ci): `BIOME_VERSION` からダブルクォートを削除

* ditto

* Apply toolchain updates

* chore: 冗長な`bunx`コマンドの呼び出しを削除

---------

Co-authored-by: s3igo <[email protected]>
  • Loading branch information
s3igo and s3igo authored Dec 22, 2024
1 parent 5c10ea3 commit 2d3d1c3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ jobs:
env:
HUSKY: 0
- name: Setup Playwright
run: bunx playwright install --with-deps ${{ matrix.browser }}
run: bun playwright install --with-deps ${{ matrix.browser }}
- name: Build app
run: bun run build
- name: Run Playwright tests
run: bunx playwright test --project ${{ matrix.browser }}
run: bun playwright test --project ${{ matrix.browser }}

vrt:
name: VRT
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/sync-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Sync toolchain versions
on:
pull_request:
paths:
- '.github/workflows/sync-toolchain.yml'
- 'flake.lock'

jobs:
Expand All @@ -18,11 +19,23 @@ jobs:
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Put Node.js version
run: nix run nixpkgs#nodejs-slim --inputs-from . -- --version > .node-version
run: |
NODE_VERSION=$(nix run nixpkgs#nodejs-slim --inputs-from . -- --version)
echo $NODE_VERSION > .node-version
nix run nixpkgs#dasel --inputs-from . -- put \
--file renovate.json \
--value ${NODE_VERSION:1} \
'packageRules.all().property(matchPackageNames?).filter(equal(type(),array)).first().filter(equal(.,@types/node)).parent().parent().allowedVersions'
BIOME_VERSION=$(nix run nixpkgs#dasel --inputs-from . -- --file package.json 'devDependencies.@biomejs/biome')
# BIOME_VERSIONはダブルクォートで囲まれた文字列なので、それを取り除く
nix shell nixpkgs#bun --inputs-from . --command bunx @biomejs/biome@${BIOME_VERSION//\"/} check --write renovate.json
- name: Put Bun version
run: |
BUN_VERSION=$(nix run nixpkgs#bun --inputs-from . -- --version)
nix run nixpkgs#dasel -- put -f wrangler.toml -v $BUN_VERSION '.vars.BUN_VERSION'
nix run nixpkgs#dasel --inputs-from . -- put \
--file wrangler.toml \
--value $BUN_VERSION \
'vars.BUN_VERSION'
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5
with:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"build:clean": "rm -rf ./dist",
"preview": "astro preview",
"check": "astro check",
"biome:fix": "bunx @biomejs/biome check --write .",
"biome:unsafe": "bunx @biomejs/biome check --write --unsafe .",
"biome:ci": "bunx @biomejs/biome ci .",
"biome:fix": "biome check --write .",
"biome:unsafe": "biome check --write --unsafe .",
"biome:ci": "biome ci .",
"lint:text": "textlint ./src/content/posts/**/*.md",
"lint:ls": "ls-lint",
"lint:knip": "knip",
Expand Down
27 changes: 20 additions & 7 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,29 @@
"enabledManagers": ["nix", "bun", "github-actions"],
"timezone": "Asia/Tokyo",
"labels": ["deps[bot]"],
"nix": { "enabled": true },
"lockFileMaintenance": { "enabled": true, "extends": ["schedule:weekly"] },
"nix": {
"enabled": true
},
"lockFileMaintenance": {
"enabled": true,
"extends": ["schedule:weekly"]
},
"packageRules": [
{ "matchUpdateTypes": "major", "addLabels": ["deps.major[bot]"] },
{ "matchUpdateTypes": "minor", "addLabels": ["deps.minor[bot]"] },
{ "matchUpdateTypes": "patch", "addLabels": ["deps.patch[bot]"] },
{
"matchManagers": ["bun"],
"matchUpdateTypes": "major",
"addLabels": ["deps.major[bot]"]
},
{
"matchUpdateTypes": "minor",
"addLabels": ["deps.minor[bot]"]
},
{
"matchUpdateTypes": "patch",
"addLabels": ["deps.patch[bot]"]
},
{
"matchPackageNames": ["@types/node"],
"versioning": "node"
"allowedVersions": "20.18.1"
}
]
}
1 change: 1 addition & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'$schema' = 'https://www.unpkg.com/wrangler/config-schema.json'
compatibility_date = '2023-02-15'
name = 'blog'
pages_build_output_dir = './dist'
Expand Down

0 comments on commit 2d3d1c3

Please sign in to comment.