Skip to content

Commit

Permalink
Merge pull request #482 from kitsuyui/cleanup-build-and-release-flows
Browse files Browse the repository at this point in the history
Cleanup build and release flows
  • Loading branch information
kitsuyui authored Dec 28, 2024
2 parents c2ca1b0 + 20b30a9 commit 7e5bf41
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 52 deletions.
38 changes: 8 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ jobs:
runs-on: ubuntu-latest

continue-on-error: true
strategy:
fail-fast: false
matrix:
package_name:
[
hello,
mymath,
string,
luxon-ext,
intended-rollback,
incremental-color-palette,
symbolic-prototype
]

steps:
- uses: actions/checkout@v4
Expand All @@ -45,29 +32,20 @@ jobs:
pnpm build
- name: update version
working-directory: packages/${{ matrix.package_name }}
if: github.event_name == 'release'
run: |
git config user.email "dummy@dummy"
git config user.name "dummy"
pnpm version from-git --allow-same-version --no-git-tag-version || true
- working-directory: packages/${{ matrix.package_name }}
run: pnpm pack

- name: Test installation
working-directory: packages/${{ matrix.package_name }}
run: |
set -eu
built_dir=$(pwd)
tempdir=$(mktemp -d)
cd $tempdir
pnpm add $built_dir/*.tgz
cd $built_dir
rm -rf $tempdir
- run: pnpm publish --access=public --no-git-checks
working-directory: packages/${{ matrix.package_name }}
- name: deploy
run: pnpm publish --access=public --no-git-checks --recursive
if: github.event_name == 'release' && !github.event.release.prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: deploy (dry-run)
run: pnpm publish --access=public --no-git-checks --dry-run --recursive
if: github.event_name != 'release' || github.event.release.prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 8 additions & 3 deletions packages/hello/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/incremental-color-palette/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/intended-rollback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/luxon-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/mymath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/string/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/symbolic-prototype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": {
"type": "./dist/index.d.mts",
"default": "./dist/index.cjs"
},
"import": {
"type": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"main": "dist/index.js",
Expand Down
17 changes: 16 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
{
"$schema": "https://turborepo.org/schema.json",
"daemon": false,
"tasks": {
"dev": {
"dependsOn": ["^dev"]
},
"@kitsuyui/hello#build": {
"outputs": ["dist"]
},
"@kitsuyui/incremental-color-palette#build": {
"outputs": ["dist"]
},
"@kitsuyui/intended-rollback#build": {
"outputs": ["dist"]
},
"@kitsuyui/standalone#dev": {},
"@kitsuyui/luxon-ext#build": {
"outputs": ["dist"]
},
"@kitsuyui/mymath#build": {
"outputs": ["dist"]
},
"@kitsuyui/string#build": {
"outputs": ["dist"]
},
"@kitsuyui/symbolic-prototype#build": {
"outputs": ["dist"]
},
"build": {
"dependsOn": ["^build"]
}
Expand Down

0 comments on commit 7e5bf41

Please sign in to comment.