diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml deleted file mode 100644 index a6e7e45..0000000 --- a/.github/workflows/gh-pages.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: deploy github pages -on: - push: - branches: - - main -jobs: - deploy: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Set up pnpm - uses: pnpm/action-setup@v2 - with: - version: 8.1.0 - run_install: true - - run: pnpm build - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./packages/simpai/build diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml deleted file mode 100644 index 15658b3..0000000 --- a/.github/workflows/npm-publish.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: npm publish -on: - release: - types: [created] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - registry-url: 'https://registry.npmjs.org' - - name: Set up pnpm - uses: pnpm/action-setup@v2 - with: - version: 8.1.0 - run_install: | - - recursive: true - args: [--frozen-lockfile] - - name: Get package name - run: | - release_name="${{ github.event.release.name }}" - words=($release_name) - package_to_publish=${words[0]} - echo "package_to_publish=${package_to_publish}" >> $GITHUB_ENV - - run: pnpm --filter "${{ env.package_to_publish }}" publish --no-git-checks - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6f342af..9c80bad 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -15,5 +15,45 @@ jobs: steps: - uses: google-github-actions/release-please-action@v3 with: - release-type: node - package-name: release-please-action + command: manifest + + # build if release was created + - uses: actions/checkout@v3 + if: ${{ steps.release.outputs.releases_created }} + - name: Setup node + uses: actions/setup-node@v3 + if: ${{ steps.release.outputs.releases_created }} + with: + node-version: '18.15.0' + registry-url: 'https://registry.npmjs.org' + - name: Set up pnpm + uses: pnpm/action-setup@v2 + if: ${{ steps.release.outputs.releases_created }} + with: + version: 8.1.0 + run_install: | + - recursive: true + args: [--frozen-lockfile] + + # build and deploy gh pages for simpai release + - run: pnpm build + if: ${{ steps.release.outputs['packages/simpai--release-created'] }} + - name: Deploy + if: ${{ steps.release.outputs['packages/simpai--release-created'] }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./packages/simpai/build + + # build and publish npm package for other releases + - name: Get package name + if: ${{ steps.release.outputs.releases_created && !steps.release.outputs['packages/simpai--release-created'] }} + run: | + tag_name="${{ steps.release.outputs.tag_name }}" + words=($tag_name) + package_to_publish=${words[0]} + echo "package_to_publish=${package_to_publish}" >> $GITHUB_ENV + - run: pnpm --filter "${{ env.package_to_publish }}" publish --no-git-checks + if: ${{ steps.release.outputs.releases_created && !steps.release.outputs['packages/simpai--release-created'] }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..bd5b75a --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + "packages/dbpf-transform": "0.0.3" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..c6293cb --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "packages": { + "packages/dbpf-transform": {}, + "packages/simpai": {} + }, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "separate-pull-requests": true, + "tag-separator": " " +}