diff --git a/.github/configuration.json b/.github/configuration.json index 1357f28..98951d0 100644 --- a/.github/configuration.json +++ b/.github/configuration.json @@ -4,7 +4,9 @@ { "title": "### ๐Ÿ› Fixes", "labels": ["fix"] }, { "title": "### โ™ป๏ธ Refactoring", "labels": ["refactor"] }, { "title": "### ๐Ÿ“ Documentation", "labels": ["docs"] }, - { "title": "### ๐Ÿงช Tests", "labels": ["test"] } + { "title": "### ๐Ÿงช Tests", "labels": ["test"] }, + { "title": "### ๐Ÿ”ง Maintenance", "labels": ["ci", "chore"] }, + { "title": "### ๐Ÿ“ฆ Other", "labels": [] } ], "ignore_labels": ["ignore-for-release"], "sort": { "order": "ASC", "on_property": "mergedAt" }, diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c8c141..75fceec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -203,9 +203,43 @@ jobs: with: files: release-bins/* body_path: ${{ runner.temp }}/RELEASE_BODY.md + # Auto-open a repo-level Discussion linked to this release, seeded with + # the same notes. Requires Discussions enabled and this category to exist. + discussion_category_name: Announcements env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Mirror the release announcement into the ORG-level discussions, which are + # backed by codellm-devkit/.github. GITHUB_TOKEN can't write cross-repo, so + # this uses a PAT/App token (ORG_DISCUSSIONS_TOKEN) with discussions:write + # on that repo, and posts via the createDiscussion GraphQL mutation. Reuses + # the already-composed RELEASE_BODY.md so org and repo posts stay identical. + - name: Announce in org-level discussions (codellm-devkit/.github) + if: startsWith(github.ref, 'refs/tags/') + continue-on-error: true # a failed org post must not fail an otherwise-good release + env: + GH_TOKEN: ${{ secrets.ORG_DISCUSSIONS_TOKEN }} + VERSION: ${{ steps.ver.outputs.version }} + run: | + set -uo pipefail + OWNER="codellm-devkit"; REPO=".github"; CATEGORY="Announcements" + # The mutation needs GraphQL node IDs, not names โ€” resolve them first. + RESP=$(gh api graphql \ + -f query='query($o:String!,$r:String!){repository(owner:$o,name:$r){id discussionCategories(first:25){nodes{id name}}}}' \ + -f o="$OWNER" -f r="$REPO") \ + || { echo "::warning::org discussion lookup failed โ€” skipping org announcement."; exit 0; } + REPO_ID=$(echo "$RESP" | jq -r '.data.repository.id') + CAT_ID=$(echo "$RESP" | jq -r --arg c "$CATEGORY" '.data.repository.discussionCategories.nodes[]|select(.name==$c)|.id') + if [[ -z "$REPO_ID" || "$REPO_ID" == "null" || -z "$CAT_ID" ]]; then + echo "::warning::could not resolve $OWNER/$REPO discussion category '$CATEGORY' โ€” skipping org announcement." + exit 0 + fi + gh api graphql \ + -f query='mutation($rid:ID!,$cid:ID!,$t:String!,$b:String!){createDiscussion(input:{repositoryId:$rid,categoryId:$cid,title:$t,body:$b}){discussion{url}}}' \ + -f rid="$REPO_ID" -f cid="$CAT_ID" \ + -f t="codeanalyzer-typescript v$VERSION" \ + -f b="$(cat "$RUNNER_TEMP/RELEASE_BODY.md")" + - name: Publish wheels to PyPI (Trusted Publishing / OIDC) if: startsWith(github.ref, 'refs/tags/') uses: pypa/gh-action-pypi-publish@release/v1