A platform for community discussion. Free, open, simple.
DEV: Automatically bump `@discourse/types` when releasing (#43259)
David Taylor1283213848a7
diff --git a/.github/workflows/publish-types.yml b/.github/workflows/publish-types.ymlindex 87bf632c1dc..a9cf26a7484 100644--- a/.github/workflows/publish-types.yml+++ b/.github/workflows/publish-types.yml@@ -23,6 +23,7 @@ jobs:- uses: actions/checkout@v7with:fetch-depth: 1+ token: ${{ secrets.GH_PUSH_TOKEN }}- uses: ruby/setup-ruby@v1with:@@ -51,8 +52,39 @@ jobs:package_version="${discourse_version}-${commit_hash}"echo "@discourse/types version: ${package_version}"+ echo "package_version=${package_version}" >> "$GITHUB_ENV"sed -i -E "s/\"version\": \"0\.0\.0\"/\"version\": \"${package_version}\"/" frontend/discourse-types/package.json- name: Publish the packageworking-directory: frontend/discourse-typesrun: pnpm publish --no-git-checks --tag latest++ - name: Bump @discourse/types in workspace package.json files+ run: |+ git checkout -- frontend/discourse-types/package.json++ pnpm update --filter './plugins/**' --filter './themes/**' \+ "discourse@npm:@discourse/types@${package_version}"++ - name: Open a PR with the bump+ env:+ GH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}+ run: |+ git config --global user.email "[email protected]"+ git config --global user.name "discoursebot"++ branch="types-bump/${package_version}"+ git checkout -b "$branch"+ git add -A++ if git diff --cached --quiet; then+ echo "Nothing to bump, skipping PR"+ exit 0+ fi++ git commit -m "DEV: Bump @discourse/types to ${package_version}"+ git push -f origin "$branch"++ title="DEV: Bump @discourse/types to ${package_version}"+ gh pr create --base main --head "$branch" --title "$title" --body "" ||+ gh pr edit "$branch" --title "$title"