diff --git a/.github/release-please.yml b/.github/release-please.yml deleted file mode 100644 index 19c4910..0000000 --- a/.github/release-please.yml +++ /dev/null @@ -1,2 +0,0 @@ -handleGHRelease: true -manifest: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 82830fe..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Publish release to registry - -on: - release: - types: [published] - -permissions: - contents: read - pull-requests: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.release.tag_name }} - -env: - REGISTRY: 'https://registry.npmjs.org' - -jobs: - publish: - name: Publish to registry - runs-on: ubuntu-latest - if: ${{ github.event.release.draft == false && github.event.release.prerelease == false }} - steps: - - name: Checkout branch - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' - registry-url: ${{ env.REGISTRY }} - - - name: Install dependencies - run: npm ci - - - name: Run build script - run: npm run build - - - name: Run publish script - env: - NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_TOKEN }} - run: npm publish - - post-release: - name: Update pull request - runs-on: ubuntu-latest - needs: [publish] - if: ${{ always() }} - env: - TAG_PREFIX: 'autorelease: ' - SUCCESS_TAG_NAME: 'published' - FAIL_TAG: 'failed' - steps: - - name: Get PR number - id: pr-number - uses: actions/github-script@v6 - with: - result-encoding: string - script: | - const query = `query($owner: String!, $repo: String!, $commit: String!) { - repository(owner: $owner, name: $repo) { - object(expression: $commit) { - ... on Commit { - associatedPullRequests(first: 1) { - nodes { - number - } - } - } - } - } - }`; - const data = await github.graphql(query, { - owner: context.repo.owner, - repo: context.repo.repo, - commit: '${{ github.event.release.target_commitish }}', - }); - const prNumber = data?.repository?.object?.associatedPullRequests?.nodes[0]?.number; - if (typeof prNumber !== 'number') { - throw new Error('Could not find the pull request that triggered this workflow run using the commit hash (${{ github.event.release.target_commitish }})'); - } - console.log(`Pull request #${prNumber} triggered the release`); - return prNumber; - - - name: Update PR autorelease tag - uses: actions/github-script@v6 - with: - script: | - const prNumber = ${{ steps.pr-number.outputs.result }}; - const currentLabels = await github.rest.issues.listLabelsOnIssue({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - }); - const filteredLabels = currentLabels.data.filter(label => !label.name.startsWith('${{ env.TAG_PREFIX }}')).map(label => label.name); - const releaseLabel = '${{ needs.publish.result }}' === 'success' ? '${{ env.TAG_PREFIX }}${{ env.SUCCESS_TAG_NAME }}' : '${{ env.TAG_PREFIX }}${{ env.FAIL_TAG }}'; - const labels = [...filteredLabels, releaseLabel]; - await github.rest.issues.setLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - labels, - }); - console.log(`Pull request #${prNumber} updated with labels:\n${labels.join(', ')}`); diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index 895bf0e..0000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "2.0.0" -} diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index c37e1bc..0000000 --- a/release-please-config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", - "pull-request-title-pattern": "chore: release v${version}", - "include-component-in-tag": false, - "include-v-in-tag": true, - "packages": { - ".": {} - } -}