Skip to content

Commit

Permalink
just checking if pr.pkg.new is working
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Aug 2, 2024
1 parent 71228d7 commit faba6c4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"linked": [ ],
"ignore": [ ],
"access": "public",
"baseBranch": "main",
"baseBranch": "origin/main",
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
Expand Down
5 changes: 5 additions & 0 deletions .changeset/six-hotels-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dmno/remix-integration": patch
---

update remix integration'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' }} ]
});
8 changes: 7 additions & 1 deletion .github/workflows/release-preview.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release preview packages
name: Release _preview_ packages
on: [push, pull_request]

jobs:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release packages

on:
push:
Expand Down
12 changes: 7 additions & 5 deletions scripts/release-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@ 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
execSync('pnpm exec changeset status --output=changesets-summary.json');

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);

0 comments on commit faba6c4

Please sign in to comment.