Skip to content
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
7 changes: 7 additions & 0 deletions .changeset/young-paths-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@naverpay/nurl": patch
---

Revert "test"

PR: [Revert "test"](https://github.com/NaverPayDev/nurl/pull/78)
41 changes: 15 additions & 26 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,27 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
canary:
get-branch:
if: ${{ github.event.issue.pull_request && (github.event.comment.body == 'canary-publish' || github.event.comment.body == '/canary-publish')}}
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.get_branch.outputs.branch }}
steps:
- name: Get PR branch name
id: get_branch
run: |
PR=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.event.issue.pull_request.url }})
echo "::set-output name=branch::$(echo $PR | jq -r '.head.ref')"

- uses: actions/checkout@v4
with:
ref: ${{ steps.get_branch.outputs.branch }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: build package
run: pnpm run build

- name: Canary Publish
uses: NaverPayDev/changeset-actions/canary-publish@oidc
with:
github_token: ${{ secrets.ACTION_TOKEN }} # Add user PAT if necessary
npm_tag: canary # Specify the npm tag to use for deployment
# npm_token: ${{ secrets.NPM_TOKEN }} # Provide the token required for npm publishing
publish_script: pnpm run release:canary # Script to execute Canary deployment
packages_dir: '.'
excludes: '.turbo,.github' # Files or directories to exclude from change detection
version_template: '{VERSION}-canary.{DATE}-{COMMITID7}'
canary:
needs: get-branch
uses: ./.github/workflows/publish.yaml
with:
publish_type: canary
npm_tag: canary
ref: ${{ needs.get-branch.outputs.branch }}
version_template: '{VERSION}-canary.{DATE}-{COMMITID7}'
packages_dir: '.'
excludes: '.turbo,.github'
secrets:
action_token: ${{ secrets.ACTION_TOKEN }}
132 changes: 132 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Publish Package

on:
workflow_call:
inputs:
publish_type:
description: 'Type of publish (release, canary, rc)'
required: true
type: string
npm_tag:
description: 'NPM tag to use for publishing'
required: false
type: string
default: 'latest'
ref:
description: 'Git ref to checkout (branch, tag, or commit)'
required: false
type: string
default: ''
version_template:
description: 'Version template for canary/rc releases'
required: false
type: string
default: ''
create_release:
description: 'Whether to create GitHub release'
required: false
type: boolean
default: false
create_github_release_tag:
description: 'Whether to create GitHub release tag'
required: false
type: boolean
default: false
pr_title:
description: 'PR title for version updates'
required: false
type: string
default: '🚀 version changed packages'
commit_message:
description: 'Commit message for version updates'
required: false
type: string
default: '📦 bump changed packages version'
git_username:
description: 'Git username for commits'
required: false
type: string
default: 'github-actions[bot]'
git_email:
description: 'Git email for commits'
required: false
type: string
default: 'github-actions[bot]@users.noreply.github.com'
packages_dir:
description: 'Directory containing packages'
required: false
type: string
default: '.'
excludes:
description: 'Files or directories to exclude from change detection'
required: false
type: string
default: '.turbo,.github'
secrets:
action_token:
description: 'GitHub Action Token'
required: true

permissions:
id-token: write
contents: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
token: ${{ secrets.action_token }}
fetch-depth: 0

- uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'

- name: Check and upgrade npm
run: |
echo "Current npm version:"
npm --version
npm install -g npm@latest
echo "Upgraded npm version:"
npm --version

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build package
run: pnpm run build

- name: Publish - Release
if: inputs.publish_type == 'release'
uses: NaverPayDev/changeset-actions/publish@oidc
with:
github_token: ${{ secrets.action_token }}
git_username: ${{ inputs.git_username }}
git_email: ${{ inputs.git_email }}
publish_script: pnpm release
pr_title: ${{ inputs.pr_title }}
commit_message: ${{ inputs.commit_message }}
create_github_release_tag: ${{ inputs.create_github_release_tag }}
formatting_script: pnpm run markdownlint:fix
env:
GITHUB_TOKEN: ${{ secrets.action_token }}

- name: Publish - Canary/RC
if: inputs.publish_type == 'canary' || inputs.publish_type == 'rc'
uses: NaverPayDev/changeset-actions/canary-publish@oidc
with:
github_token: ${{ secrets.action_token }}
npm_tag: ${{ inputs.npm_tag }}
publish_script: pnpm run release:canary
packages_dir: ${{ inputs.packages_dir }}
excludes: ${{ inputs.excludes }}
version_template: ${{ inputs.version_template }}
create_release: ${{ inputs.create_release }}
58 changes: 16 additions & 42 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,29 @@ on:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write # to create release
id-token: write

jobs:
rc:
get-branch:
if: ${{ github.event.issue.pull_request && (github.event.comment.body == 'rc-publish' || github.event.comment.body == '/rc-publish')}}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
branch: ${{ steps.get_branch.outputs.branch }}
steps:
- name: Get PR branch name
id: get_branch
run: |
PR=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.event.issue.pull_request.url }})
echo "::set-output name=branch::$(echo $PR | jq -r '.head.ref')"

- uses: actions/checkout@v4
with:
ref: ${{ steps.get_branch.outputs.branch }}
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'

- name: Check and upgrade npm
run: |
echo "Current npm version:"
npm --version
npm install -g npm@latest
echo "Upgraded npm version:"
npm --version

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: build package
run: pnpm run build

- name: RC Publish
uses: NaverPayDev/changeset-actions/canary-publish@oidc
with:
github_token: ${{ secrets.ACTION_TOKEN }} # Add user PAT if necessary
npm_tag: rc # Specify the npm tag to use for deployment
# npm_token: ${{ secrets.NPM_TOKEN }} # Provide the token required for npm publishing
publish_script: pnpm run release:canary # Script to execute Canary deployment
packages_dir: '.'
excludes: '.turbo,.github' # Files or directories to exclude from change detection
version_template: '{VERSION}-rc.{DATE}-{COMMITID7}'
create_release: true
rc:
needs: get-branch
uses: ./.github/workflows/publish.yaml
with:
publish_type: rc
npm_tag: rc
ref: ${{ needs.get-branch.outputs.branch }}
version_template: '{VERSION}-rc.{DATE}-{COMMITID7}'
packages_dir: '.'
excludes: '.turbo,.github'
create_release: true
secrets:
action_token: ${{ secrets.ACTION_TOKEN }}
49 changes: 10 additions & 39 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,18 @@ on:
branches:
- main

permissions:
id-token: write
contents: read

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTION_TOKEN }}
fetch-depth: 0

- uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: build package
run: pnpm run build

- name: Create Release Pull Request
id: changesets
uses: NaverPayDev/changeset-actions/publish@oidc
with:
github_token: ${{ secrets.ACTION_TOKEN }}
git_username: npayfebot
git_email: [email protected]
publish_script: pnpm release
pr_title: '🚀 version changed packages'
commit_message: '📦 bump changed packages version'
create_github_release_tag: true
formatting_script: pnpm run markdownlint:fix
# npm_token: ${{ secrets.NPM_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
uses: ./.github/workflows/publish.yaml
with:
publish_type: release
git_username: npayfebot
git_email: [email protected]
pr_title: '🚀 version changed packages'
commit_message: '📦 bump changed packages version'
create_github_release_tag: true
secrets:
action_token: ${{ secrets.ACTION_TOKEN }}
2 changes: 2 additions & 0 deletions src/punycode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const baseMinusTMin: number = base - tMin
const floor: (x: number) => number = Math.floor
const stringFromCharCode: (...codes: number[]) => string = String.fromCharCode

/* -------------------------------------------------------------------------- */

/**
* A generic error utility function.
* @private
Expand Down