-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added bun parsing (faster) and some config npm deploying tests
- Loading branch information
1 parent
82d550a
commit c2b9afc
Showing
10 changed files
with
108 additions
and
1,215 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,25 @@ | ||
name: Bump package version and tag it | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
bump-and-tag: | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
name: Bump and Tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get Tags | ||
run: git fetch origin +refs/tags/*:refs/tags/* | ||
|
||
- name: Bump Version | ||
id: bump_and_tag | ||
uses: konsentus/action.bump-version-and-tag@v2 |
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,25 @@ | ||
name: Publish new NPM package version on tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: "1.0.0" | ||
- name: Install packages 📦 | ||
run: bun install | ||
- name: Lint the config files 🧹 | ||
run: bun lint | ||
- name: Build and publish 📣 | ||
run: bun dle-publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
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,33 @@ | ||
#!/usr/bin/env ts-node | ||
|
||
import { constants } from "🛠️"; | ||
import { readdir } from "fs/promises"; | ||
import formatting from "kleur"; | ||
|
||
// This will create a single `config.json` file | ||
|
||
const allowedEnvNames = ["development", "production", "staging"]; | ||
|
||
async function generateConfig() { | ||
const allowedConfigNames = await readdir(constants.distFolder); | ||
console.log("allowedConfigNames", allowedConfigNames); | ||
const envName = process.argv[3]; | ||
const configName = process.argv[2]; | ||
if (!allowedEnvNames.includes(envName)) { | ||
throw new Error( | ||
`Invalid environment name. Allowed names: ${allowedEnvNames.join(", ")}` | ||
); | ||
} | ||
if (!allowedConfigNames.includes(configName)) { | ||
throw new Error( | ||
`Invalid config name. Allowed names: ${allowedConfigNames.join(", ")}` | ||
); | ||
} | ||
console.log( | ||
formatting.cyan( | ||
`Generating ${configName} config for ${envName} environment` | ||
) | ||
); | ||
} | ||
|
||
generateConfig(); |
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
Oops, something went wrong.