diff --git a/.github/actions/upload-versions/action.yml b/.github/actions/upload-versions/action.yml deleted file mode 100644 index df644c6c0bb..00000000000 --- a/.github/actions/upload-versions/action.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: 'Upload Versions' -description: 'Upload version information for public packages' -runs: - using: 'composite' - steps: - - name: Set up Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 - with: - node-version: 22 - - name: Write workspace versions as JSON file - uses: actions/github-script@a3e7071a34d7e1f219a8a4de9a5e0a34d1ee1293 - with: - script: | - const fs = require('node:fs'); - - const globber = await glob.create(['packages/**/package.json', '!**/node_modules/**'].join('\n')) - const packageJsonPaths = await globber.glob() - const output = { - packages: [], - }; - - for (const packageJsonPath of packageJsonPaths) { - const contents = fs.readFileSync(packageJsonPath, 'utf8'); - const packageJson = JSON.parse(contents); - if (packageJson.private) { - continue; - } - - const pkg = { - name: packageJson.name, - version: packageJson.version, - }; - output.packages.push(pkg); - } - - fs.writeFileSync('versions.json', JSON.stringify(output, null, 2)); - - name: Upload version file - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 - with: - name: versions - path: versions.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7274d70f39..3ea6e972ed6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,11 @@ name: Release on: push: + # Ignore merge queue branches and all tags + branches-ignore: + - 'gh-readonly-queue/**' + tags-ignore: + - '**' workflow_dispatch: concurrency: @@ -54,7 +59,9 @@ jobs: publish: npm run release env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - - uses: ./.github/actions/upload-versions + + - name: Upload versions json file + uses: primer/.github/.github/actions/upload-versions@v2.4.0 release-candidate: if: github.ref_name == 'changeset-release/main' @@ -94,21 +101,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Output candidate version - uses: actions/github-script@a3e7071a34d7e1f219a8a4de9a5e0a34d1ee1293 - with: - script: | - const package = require(`${process.env.GITHUB_WORKSPACE}/packages/react/package.json`) - github.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: 'success', - context: `Published ${package.name}`, - description: package.version, - target_url: `https://unpkg.com/${package.name}@${package.version}/` - }) - - uses: ./.github/actions/upload-versions + - name: Report versions + uses: primer/.github/.github/actions/report-versions@v2.4.0 + + - name: Upload versions json file + uses: primer/.github/.github/actions/upload-versions@v2.4.0 release-canary: name: Canary @@ -140,18 +137,9 @@ jobs: npx changeset publish --tag canary env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Output canary version - uses: actions/github-script@a3e7071a34d7e1f219a8a4de9a5e0a34d1ee1293 - with: - script: | - const package = require(`${process.env.GITHUB_WORKSPACE}/packages/react/package.json`) - github.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.sha, - state: 'success', - context: `Published ${package.name}`, - description: package.version, - target_url: `https://unpkg.com/${package.name}@${package.version}/` - }) - - uses: ./.github/actions/upload-versions + + - name: Report versions + uses: primer/.github/.github/actions/report-versions@v2.4.0 + + - name: Upload versions json file + uses: primer/.github/.github/actions/upload-versions@v2.4.0