Skip to content

Commit

Permalink
build: allow build to split (#703)
Browse files Browse the repository at this point in the history
* build: allow build to split

* ci: remove update-version script

* ci: update yamls

* ci: test get version step

* ci: update yamls
  • Loading branch information
ogzhanolguncu authored Oct 31, 2023
1 parent f79c0d6 commit 09c5ecd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: lts/*

Expand All @@ -26,7 +26,7 @@ jobs:

- name: Set package version
run: |
bun run ./scripts/set-version.js . ${{ env.VERSION }}
echo $(jq --arg v "${{ env.VERSION }}" '(.version) = $v' package.json) > package.json
echo "export const VERSION='${{ env.VERSION }}'" > ./version.ts
- name: Install Dependencies
Expand All @@ -48,4 +48,4 @@ jobs:
if: "github.event.release.prerelease"
working-directory: ./dist
run: |
npm publish --access public --tag=next
npm publish --access public --tag=next
31 changes: 15 additions & 16 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install bun
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -327,7 +327,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -381,7 +381,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -419,7 +419,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -476,7 +476,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install bun
Expand Down Expand Up @@ -529,7 +529,7 @@ jobs:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand Down Expand Up @@ -572,17 +572,16 @@ jobs:
run: echo "::set-output name=version::v0.0.0-ci.${GITHUB_SHA}-$(date +%Y%m%d%H%M%S)"

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install bun
run: npm install -g bun

- name: Set package version
- name: Set version
run: |
bun run ./scripts/set-version.js . ${{ steps.version.outputs.version }}
echo "export const VERSION='${{ steps.version.outputs.version }}'" > ./version.ts
echo $(jq --arg v "${{ steps.version.outputs.version }}" '(.version) = $v' package.json) > package.json
- name: Install Dependencies
run: bun install
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"devDependencies": {
"@types/crypto-js": "^4.1.3",
"bun-types": "^1.0.6",
"tsup": "^7.2.0"
"tsup": "^7.2.0",
"@biomejs/biome": "^1.3.0"
},
"dependencies": {
"@biomejs/biome": "^1.3.0",
"crypto-js": "^4.1.1"
"crypto-js": "^4.2.0"
}
}
19 changes: 0 additions & 19 deletions scripts/set-version.js

This file was deleted.

2 changes: 1 addition & 1 deletion tsup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["platforms/nodejs.ts", "platforms/cloudflare.ts", "platforms/fastly.ts"],
format: ["cjs", "esm"],
splitting: false,
splitting: true,
sourcemap: false,
clean: true,
bundle: true,
Expand Down

0 comments on commit 09c5ecd

Please sign in to comment.