From faba6c4d9e9c2b25fa52e214b172f727ab75014f Mon Sep 17 00:00:00 2001 From: Theo Ephraim Date: Thu, 1 Aug 2024 21:33:17 -0700 Subject: [PATCH] just checking if pr.pkg.new is working --- .changeset/config.json | 2 +- .changeset/six-hotels-clean.md | 5 +++++ .../{external-pr-labeler.yaml => pr-labeler.yaml} | 13 +++++++------ .github/workflows/release-preview.yaml | 8 +++++++- .github/workflows/release.yaml | 2 +- scripts/release-preview.js | 12 +++++++----- 6 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 .changeset/six-hotels-clean.md rename .github/workflows/{external-pr-labeler.yaml => pr-labeler.yaml} (69%) diff --git a/.changeset/config.json b/.changeset/config.json index 370f0385..6af6a8db 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -6,7 +6,7 @@ "linked": [ ], "ignore": [ ], "access": "public", - "baseBranch": "main", + "baseBranch": "origin/main", "updateInternalDependencies": "patch", "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { "onlyUpdatePeerDependentsWhenOutOfRange": true diff --git a/.changeset/six-hotels-clean.md b/.changeset/six-hotels-clean.md new file mode 100644 index 00000000..0e641d6d --- /dev/null +++ b/.changeset/six-hotels-clean.md @@ -0,0 +1,5 @@ +--- +"@dmno/remix-integration": patch +--- + +update remix integration' diff --git a/.github/workflows/external-pr-labeler.yaml b/.github/workflows/pr-labeler.yaml similarity index 69% rename from .github/workflows/external-pr-labeler.yaml rename to .github/workflows/pr-labeler.yaml index ae417d66..ddee556a 100644 --- a/.github/workflows/external-pr-labeler.yaml +++ b/.github/workflows/pr-labeler.yaml @@ -16,17 +16,18 @@ jobs: issues: write pull-requests: write env: - DMNO_STAFF: "theoephraim philmillman" + # pre-approved maintainers list (dmno staff) + MAINTAINERS_LIST: "theoephraim philmillman" steps: - name: Check PR author id: check_author run: | PR_AUTHOR="${{ github.event.pull_request.user.login }}" - if ! [[ "${DMNO_STAFF}" =~ "$PR_AUTHOR" ]]; then - echo "Authored by DMNO community member!" - echo "requires-community-tag=true" >> $GITHUB_OUTPUT + if [[ "${MAINTAINERS_LIST}" =~ "$PR_AUTHOR" ]]; then + echo "Authored by pre-approved maintainer" + echo "official-maintainer=true" >> $GITHUB_OUTPUT else - echo "Authored by DMNO staff" + echo "Authored by DMNO community member!" fi - name: Label PR uses: actions/github-script@v5 @@ -36,5 +37,5 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: ${{ github.event.pull_request.number }}, - labels: [ steps.check_author.outputs.requires-community-tag && 'community' && 'staff' ] + labels: [ {{ steps.check_author.outputs.official-maintainer && 'maintainer' || 'community' }} ] }); diff --git a/.github/workflows/release-preview.yaml b/.github/workflows/release-preview.yaml index 5cd6856f..fb6044ae 100644 --- a/.github/workflows/release-preview.yaml +++ b/.github/workflows/release-preview.yaml @@ -1,4 +1,4 @@ -name: Release preview packages +name: Release _preview_ packages on: [push, pull_request] jobs: @@ -7,6 +7,12 @@ jobs: steps: - uses: actions/checkout@v4 + - run: git fetch origin main + with: + # by default only the current commit is fetched + # but we need more history to be able to compare to main + # TODO: ideally we would just fetch the history between origin/main and the current commit + fetch-depth: 0 - name: Enable Corepack run: corepack enable - name: Use Node.js 20.x diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 136b8879..e3920822 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Release +name: Release packages on: push: diff --git a/scripts/release-preview.js b/scripts/release-preview.js index 33067b73..df50acc3 100644 --- a/scripts/release-preview.js +++ b/scripts/release-preview.js @@ -6,7 +6,7 @@ try { // pnpm m ls --json --depth=-1 | node -e "const path = require('path'); console.log(JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8')).map((m) => path.relative(__dirname, m.path)).filter(Boolean))" const workspacePackagesInfoRaw = execSync('pnpm m ls --json --depth=-1'); const workspacePackagesInfo = JSON.parse(workspacePackagesInfoRaw); - console.log(workspacePackagesInfo); + // console.log(workspacePackagesInfo); // generate sumamry of changed (publishable) modules according to changesets // only has option to output to a file @@ -14,20 +14,22 @@ try { const changeSetsSummaryRaw = fs.readFileSync('./changesets-summary.json', 'utf8'); const changeSetsSummary = JSON.parse(changeSetsSummaryRaw); - console.log(changeSetsSummary); + // console.log(changeSetsSummary); const releasePackagePaths = changeSetsSummary.releases .filter((r) => r.newVersion !== r.oldVersion) .map((r) => workspacePackagesInfo.find((p) => p.name === r.name)) .map((p) => p.path); - console.log(releasePackagePaths); + // console.log(releasePackagePaths); + + const publishResult = execSync(`pnpm dlx pkg-pr-new publish --compact ${releasePackagePaths.join(' ')}`); + console.log('published preview packages!') + console.log(publishResult); - execSync(`pnpm dlx pkg-pr-new publish --compact ${releasePackagePaths.join(' ')}`); } catch (_err) { err = _err; console.error('preview release failed'); console.error(_err); } -console.log(`CWD = ${process.cwd()}`); fs.unlinkSync('./changesets-summary.json'); process.exit(err ? 1 : 0);