diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index e621b5bc..2a89b44a 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -5,11 +5,43 @@ on: branches: - main + workflow_dispatch: + inputs: + force-npm-publish: + description: "Force npm publish" + type: boolean + +permissions: + contents: write + pull-requests: write + jobs: publish-release: - uses: mdn/workflows/.github/workflows/publish-release.yml@main - with: - target-repo: "mdn/data" - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + if: github.repository == 'mdn/data' + runs-on: ubuntu-latest + + steps: + - name: Release + uses: GoogleCloudPlatform/release-please-action@v4 + id: release + + - name: Setup + if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} + uses: actions/checkout@v4 + + - name: Checkout + if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} + uses: actions/setup-node@v4 + with: + registry-url: "https://registry.npmjs.org/" + node-version-file: ".nvmrc" + + - name: Install + if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} + run: npm ci + + - name: Publish + if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..3f430af8 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..655adde8 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.4.2" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..e37d9ac3 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "last-release-sha": "0a7a19329406b0e8f555083f7dcdd6e84a3d4707", + "release-type": "node", + "changelog-sections": [ + { "type": "feat", "section": "Features", "hidden": false }, + { "type": "fix", "section": "Bug Fixes", "hidden": false }, + { "type": "enhance", "section": "Enhancements", "hidden": false }, + { "type": "chore", "section": "Miscellaneous", "hidden": false } + ], + "include-component-in-tag": false, + "packages": { + ".": {} + } +}