From 3560dfdc04bf1efe161f53f383671cd222ddf303 Mon Sep 17 00:00:00 2001 From: Abe Tomoaki Date: Wed, 18 Feb 2026 14:01:24 +0900 Subject: [PATCH] ci release: Notify Discord --- .github/release-notification.yml | 25 +++++++++++++++++++++++++ .github/workflows/package.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/release-notification.yml diff --git a/.github/release-notification.yml b/.github/release-notification.yml new file mode 100644 index 0000000..087a07d --- /dev/null +++ b/.github/release-notification.yml @@ -0,0 +1,25 @@ +# Copyright 2026 Enactic, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +changelog: + exclude: + authors: + - dependabot[bot] + categories: + - title: "Highlights" + labels: + - "important" + - title: "Other Changes" + labels: + - "*" diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 32d6dd3..2af87b4 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -308,3 +308,32 @@ jobs: mkdir -p dist mv openarm_can-*.tar.gz dist/ - uses: pypa/gh-action-pypi-publish@release/v1 + notification: + name: Notification + if: github.ref_type == 'tag' + needs: + - pypi + - release + runs-on: ubuntu-latest + steps: + - name: Post to Discord + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + GH_TOKEN: ${{ github.token }} + run: | + gh api "repos/${GITHUB_REPOSITORY}/releases/generate-notes" \ + --raw-field tag_name="${GITHUB_REF_NAME}" \ + --raw-field configuration_file_path=.github/release-notification.yml \ + --jq .body | + sed 's///g' | + tee content.md + + echo "## Help and Feedback" | tee -a content.md + echo "If you have any CAN related problems or improvements, please file them to https://github.com/enactic/openarm_can/issues and/or https://github.com/enactic/openarm_can/pulls !" | tee -a content.md + + curl --request POST "${DISCORD_WEBHOOK_URL}" \ + --header "Content-Type: application/json" \ + --data "$(jq --null-input \ + --arg thread_name "OpenArm CAN ${VERSION}" \ + --arg content "$(cat content.md)" \ + '{thread_name: $thread_name, content: $content}')"