diff --git a/.github/workflows/changeset-publish.yml b/.github/workflows/changeset-publish.yml new file mode 100644 index 0000000..a8892de --- /dev/null +++ b/.github/workflows/changeset-publish.yml @@ -0,0 +1,42 @@ +name: changeset-publish + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.ACTION_TOKEN }} + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - uses: NaverPayDev/changeset-actions/publish@main + with: + github_token: ${{ secrets.ACTION_TOKEN }} + npm_token: ${{ secrets.NPM_TOKEN }} + publish_script: pnpm release + git_username: npay-fe-bot + git_email: npay.fe.bot@navercorp.com + pr_title: 🚀 version changed packages + commit_message: 📦 bump changed packages version + create_github_release_tag: true + formatting_script: pnpm markdownlint:fix diff --git a/.github/workflows/changesets-detect-add.yml b/.github/workflows/changesets-detect-add.yml new file mode 100644 index 0000000..e4be61b --- /dev/null +++ b/.github/workflows/changesets-detect-add.yml @@ -0,0 +1,39 @@ +name: changeset-detect-add +on: + pull_request: + branches: + - '**' + types: [opened, reopened, synchronize] + +jobs: + detect-add: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.ACTION_TOKEN }} + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Detect Changed Packages + uses: NaverPayDev/changeset-actions/detect-add@main + with: + github_token: ${{ secrets.ACTION_TOKEN }} + packages_dir: packages + skip_label: skip-detect-change + skip_branches: main + formatting_script: pnpm markdownlint:fix diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 3b9ed89..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: release packages - -on: - push: - branches: - - main - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Setup Node.js 20.x - uses: actions/setup-node@v3 - with: - node-version: 20.x - - - name: Install dependencies - uses: pnpm/action-setup@v3 - with: - version: 9 - run_install: true - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - title: '🚀 version changed packages' - commit: '📦 bump changed packages version' - publish: pnpm release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }}