diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml deleted file mode 100644 index fc1d7330..00000000 --- a/.github/workflows/publish-canary.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Publish canary version - -on: - push: - branches: - - canary - paths-ignore: - - '**/package.json' - - 'lerna.json' - - '**.md' - - 'packages/example/**' - -jobs: - publish: - name: Publish - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: pnpm/action-setup@v4 - with: - version: 10 - - - name: Setup node - uses: actions/setup-node@v4 - with: - cache: 'pnpm' - node-version: 24 - registry-url: 'https://registry.npmjs.org' - - - name: ビルド時に使用する環境変数を設定 - run: | - touch ./packages/zenn-cli/.env - echo VITE_EMBED_SERVER_ORIGIN=${{ vars.VITE_EMBED_SERVER_ORIGIN }} >> ./packages/zenn-cli/.env - - - name: パッケージをインストール - run: pnpm install - - # Enable lerna to commit on GitHub. - # Note that this does not work with protected branch. - - name: Configure git identity - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - run: pnpm build - - # zenn-editor packages does not follow semantic versioning. - # This is because anyone should use latest version which is synced with zenn.dev - - name: Bump version to canary - run: pnpm lerna version prerelease --yes --no-private - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set released version to env - run: node -p -e '`RELEASED_PACKAGE_VERSION=${require("./lerna.json").version}`' >> $GITHUB_ENV - - - name: Create release - uses: release-drafter/release-drafter@v5 - with: - version: ${{ env.RELEASED_PACKAGE_VERSION }} - name: ${{ env.RELEASED_PACKAGE_VERSION }} - tag: ${{ env.RELEASED_PACKAGE_VERSION }} - publish: true - prerelease: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish canary - run: pnpm lerna publish from-package --yes --pre-dist-tag canary - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish.yml similarity index 62% rename from .github/workflows/publish-latest.yml rename to .github/workflows/publish.yml index a830fe9f..bdcd0eb9 100644 --- a/.github/workflows/publish-latest.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,11 @@ -name: Publish latest version +name: Publish on: workflow_dispatch: push: branches: - main + - canary paths-ignore: - '**/package.json' - 'lerna.json' @@ -41,8 +42,7 @@ jobs: - name: パッケージをインストール run: pnpm install - # Enable lerna to commit on GitHub. - # Note that this does not work with protected branch. + # lernaがGitHub上でコミットできるようにする - name: Configure git identity run: | git config --global user.name 'github-actions[bot]' @@ -54,37 +54,64 @@ jobs: - name: Build run: pnpm build - # zenn-editor packages does not follow semantic versioning. - # This is because anyone should use latest version which is synced with zenn.dev - - name: Bump version to latest + - name: '[main] Bump version' + if: github.ref_name == 'main' run: pnpm lerna version patch --yes --no-private env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: '[canary] Bump version' + if: github.ref_name == 'canary' + run: pnpm lerna version prerelease --yes --no-private + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set released version to env run: node -p -e '`RELEASED_PACKAGE_VERSION=${require("./lerna.json").version}`' >> $GITHUB_ENV - - name: Create release + - name: '[main] Create release' + if: github.ref_name == 'main' + uses: release-drafter/release-drafter@v5 + with: + version: ${{ env.RELEASED_PACKAGE_VERSION }} + name: ${{ env.RELEASED_PACKAGE_VERSION }} + tag: ${{ env.RELEASED_PACKAGE_VERSION }} + publish: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: '[canary] Create release' + if: github.ref_name == 'canary' uses: release-drafter/release-drafter@v5 with: version: ${{ env.RELEASED_PACKAGE_VERSION }} name: ${{ env.RELEASED_PACKAGE_VERSION }} tag: ${{ env.RELEASED_PACKAGE_VERSION }} publish: true + prerelease: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish latest + - name: '[main] Publish' + if: github.ref_name == 'main' run: pnpm lerna publish from-package --yes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Checkout + - name: '[canary] Publish' + if: github.ref_name == 'canary' + run: pnpm lerna publish from-package --yes --pre-dist-tag canary + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: '[main] Checkout' + if: github.ref_name == 'main' uses: actions/checkout@v2 with: ref: canary - - name: Reflect changes on main branch to canary branch. + - name: '[main] Reflect changes on main branch to canary branch' + if: github.ref_name == 'main' run: | git pull origin main git push origin HEAD diff --git a/.gitignore b/.gitignore index 57783c84..8373e91b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ lerna-debug.log mise.toml .serena .pnpm-store +.rulesync/*/my-* # Generated by rulesync - AI tool configuration files **/.amazonq/ diff --git a/rulesync.jsonc b/rulesync.jsonc new file mode 100644 index 00000000..4815e143 --- /dev/null +++ b/rulesync.jsonc @@ -0,0 +1,10 @@ +{ + "targets": ["copilot", "cursor", "claudecode", "codexcli"], + "features": ["rules", "ignore", "mcp", "commands", "subagents"], + "baseDirs": ["."], + "delete": true, + "verbose": false, + "experimentalGlobal": false, + "experimentalSimulateCommands": false, + "experimentalSimulateSubagents": false, +}