Skip to content

Commit

Permalink
Merge pull request #62 from rycont/unified-version-applier
Browse files Browse the repository at this point in the history
Unified version applier
rycont authored Dec 17, 2024
2 parents cd6800a + a4a2c5c commit fcfe568
Showing 8 changed files with 55 additions and 74 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/publish-quickjs.yml

This file was deleted.

14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -23,8 +23,14 @@ jobs:
with:
deno-version: v2.x

- name: Run tests
run: deno task test
- name: Apply Workspace Version
run: deno task apply-version

- name: Install Dependencies
run: deno install --allow-scripts

- name: Publish to JSR
run: deno publish

- name: Get version from deno.json
id: get_version
@@ -36,7 +42,3 @@ jobs:
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git tag -a v${{ steps.get_version.outputs.version }} -m "Release version ${{ steps.get_version.outputs.version }}"
git push origin v${{ steps.get_version.outputs.version }}
continue-on-error: true

- name: Publish to JSR
run: deno publish
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Test

on:
push:
branches: ['main']
pull_request:
branches: ['main']

@@ -22,6 +20,9 @@ jobs:
with:
deno-version: v2.x

- name: Apply Workspace Version
run: deno task apply-version

- name: Install Dependencies
run: deno install --allow-scripts

18 changes: 18 additions & 0 deletions apply-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const rootModule = JSON.parse(await Deno.readTextFile('./deno.json'))
const subModules = rootModule.workspace

for (const subModule of subModules) {
const subModulePath = `./${subModule}/deno.json`
const subModuleJson = JSON.parse(await Deno.readTextFile(subModulePath))

if (!subModuleJson.name) {
continue
}

subModuleJson.version = rootModule.version

await Deno.writeTextFile(
subModulePath,
JSON.stringify(subModuleJson, null, 2),
)
}
20 changes: 10 additions & 10 deletions core/deno.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"tasks": {
"coverage": "rm -rf ./cov && deno test --quiet --allow-net --allow-read --parallel --coverage=cov && deno coverage --detailed ./cov && rm -rf ./cov",
"coverage-list": "rm -rf ./cov && deno test --quiet --allow-net --allow-read --parallel --coverage=cov && deno coverage ./cov && rm -rf ./cov",
"check-circular-dependencies": "deno run -A npm:madge --circular --extensions ts ./",
"check-deploy": "deno publish --dry-run --allow-dirty",
"test": "deno task check-circular-dependencies & deno task check-deploy"
},
"name": "@dalbit-yaksok/core",
"version": "0.2.0-alpha.9+20241212.nightly",
"exports": "./mod.ts"
"tasks": {
"coverage": "rm -rf ./cov && deno test --quiet --allow-net --allow-read --parallel --coverage=cov && deno coverage --detailed ./cov && rm -rf ./cov",
"coverage-list": "rm -rf ./cov && deno test --quiet --allow-net --allow-read --parallel --coverage=cov && deno coverage ./cov && rm -rf ./cov",
"check-circular-dependencies": "deno run -A npm:madge --circular --extensions ts ./",
"check-deploy": "deno publish --dry-run --allow-dirty",
"test": "deno task check-circular-dependencies & deno task check-deploy"
},
"name": "@dalbit-yaksok/core",
"exports": "./mod.ts",
"version": "0.2.0-alpha.10+20241217.nightly"
}
8 changes: 4 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@
"core",
"test"
],
"publish": {
"include": [
"./src"
]
"version": "0.2.0-alpha.10+20241217.nightly",
"tasks": {
"apply-version": "deno run --allow-read --allow-write apply-version.ts",
"publish": "deno task --recursive test && deno publish --allow-dirty"
}
}
4 changes: 1 addition & 3 deletions docs/deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"name": "@dalbit-yaksok/docs",
"imports": {
"@deno/vite-plugin": "npm:@deno/vite-plugin@^1.0.2",
"@vue/runtime-dom": "npm:@vue/runtime-dom@^3.5.12",
@@ -21,6 +20,5 @@
"dev": "deno task typedoc --watch & deno task vitepress-dev",
"build": "deno task purge; deno task typedoc && deno task vitepress-build",
"test": "deno task build; deno task purge"
},
"exports": "./docs/.vitepress/dist"
}
}
22 changes: 11 additions & 11 deletions quickjs/deno.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@dalbit-yaksok/quickjs",
"exports": "./mod.ts",
"imports": {
"quickjs-emscripten": "npm:quickjs-emscripten@^0.31.0",
"quickjs-emscripten-core": "npm:quickjs-emscripten-core@^0.31.0"
},
"version": "0.2.0-alpha.9+20241212.nightly",
"tasks": {
"check-deploy": "deno publish --dry-run --allow-dirty",
"test": "deno test --quiet --allow-net --allow-read --parallel & deno lint & deno task check-deploy"
}
"name": "@dalbit-yaksok/quickjs",
"exports": "./mod.ts",
"imports": {
"quickjs-emscripten": "npm:quickjs-emscripten@^0.31.0",
"quickjs-emscripten-core": "npm:quickjs-emscripten-core@^0.31.0"
},
"tasks": {
"check-deploy": "deno publish --dry-run --allow-dirty",
"test": "deno test --quiet --allow-net --allow-read --parallel & deno lint & deno task check-deploy"
},
"version": "0.2.0-alpha.10+20241217.nightly"
}

0 comments on commit fcfe568

Please sign in to comment.