-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: publish to registries + build process (#14)
* publish to registries + build process * feat: add pnpm lockfile --------- Co-authored-by: 0xsign <0xsign@protonmail.com>
- Loading branch information
Showing
26 changed files
with
3,397 additions
and
1,545 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,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
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 @@ | ||
NODE_ENV="development" |
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,103 @@ | ||
name: 'Release' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v*' | ||
branches: | ||
# for debugging purposes | ||
- 'debug-*' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
# Enable debug logging for actions | ||
ACTIONS_RUNNER_DEBUG: true | ||
|
||
jobs: | ||
changelog: | ||
name: 'Generate Changelog' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- name: 'Generate Changelog' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: bunx changelogithub --no-group | ||
continue-on-error: true | ||
|
||
publish-npm: | ||
name: 'NPM Registry' | ||
needs: [changelog] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Setup Node.js' | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
cache: 'yarn' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: 'Install Dependencies' | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: 'Build' | ||
env: | ||
NODE_ENV: 'production' | ||
run: yarn build | ||
|
||
- name: 'Publish' | ||
env: | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn publish --access='public' --registry='https://registry.npmjs.org' --no-git-checks | ||
publish-gpr: | ||
name: 'GitHub Package Registry' | ||
needs: [changelog] | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Setup Node.js' | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
cache: 'yarn' | ||
registry-url: 'https://npm.pkg.github.com' | ||
|
||
- name: 'Install Dependencies' | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: 'Build' | ||
env: | ||
NODE_ENV: 'production' | ||
run: yarn build | ||
|
||
- name: 'Update ~/.npmrc' | ||
run: | | ||
echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc | ||
- name: 'Publish' | ||
env: | ||
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
yarn publish --access='public' --registry='https://npm.pkg.github.com' --no-git-checks |
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,3 @@ | ||
auto-install-peers=true | ||
enable-pre-post-scripts=true | ||
strict-peer-dependencies=false |
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,5 @@ | ||
declare module NodeJS { | ||
interface ProcessEnv { | ||
NODE_ENV: 'development' | 'production' | 'test' | ||
} | ||
} |
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.