Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup build and release flows #482

Merged
merged 4 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading