-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eaf1029
commit e803b37
Showing
4 changed files
with
172 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
env: | ||
CI: true | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [16, 18] | ||
typescript: ["~4.5.5", "~4.6.4", "~4.7.4", "~4.8.3", "~4.9.5", "~5.0.4"] | ||
name: Node ${{ matrix.node }} / TS ${{ matrix.typescript }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install node_modules | ||
uses: ./.github/actions/install-node-modules | ||
with: | ||
node-version: ${{ matrix.node }} | ||
typescript-version: ${{ matrix.typescript }} | ||
|
||
- name: Run tests | ||
run: yarn test | ||
|
||
deploy: | ||
name: Deploy | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install node_modules | ||
uses: ./.github/actions/install-node-modules | ||
with: | ||
node-version: 18 | ||
typescript-version: ~5.0.4 | ||
|
||
- name: Set package version | ||
run: yarn set-package-version ${{ github.event.release.tag_name }} | ||
|
||
- name: Clear lib directory | ||
run: rm -rf lib | ||
|
||
- name: Clear builds directory | ||
run: rm -rf builds | ||
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Building deno build | ||
run: yarn rollup -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { readFileSync, writeFileSync } from "fs"; | ||
import { join } from "path"; | ||
|
||
const newVersionTag = process.argv[2] as string | undefined; | ||
|
||
const semanticVersioningRegex = | ||
/^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; | ||
|
||
if ( | ||
newVersionTag === undefined || | ||
!semanticVersioningRegex.test(newVersionTag) | ||
) { | ||
throw new Error("Invalid version"); | ||
} | ||
|
||
const NEW_VERSION = newVersionTag.slice(1); | ||
|
||
console.log(NEW_VERSION); | ||
|
||
type PackageJson = { | ||
version?: string; | ||
dependencies?: Record<string, string>; | ||
devDependencies?: Record<string, string>; | ||
peerDependencies?: Record<string, string>; | ||
}; | ||
|
||
const packageJsonPath = join(__dirname, "..", "package.json"); | ||
|
||
const packageJson = JSON.parse( | ||
readFileSync(packageJsonPath).toString(), | ||
) as PackageJson; | ||
|
||
packageJson.version = NEW_VERSION; | ||
|
||
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters