diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d314f66..68ce5ca4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -259,3 +259,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | ./src/scripts/release/add_pr_comments_on_release.sh + + - name: Send Slack notifications about release + run: | + python ./src/scripts/release/slack_notification.py '${{ secrets.SLACK_WEBHOOK_URL}}' diff --git a/src/scripts/release/slack_notification.py b/src/scripts/release/slack_notification.py new file mode 100644 index 00000000..ed257a28 --- /dev/null +++ b/src/scripts/release/slack_notification.py @@ -0,0 +1,26 @@ +import argparse + +import requests + +from olmo_core.version import VERSION + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser( + "slack-notifier", description="Send a release notifcation to a Slack channel." + ) + parser.add_argument("webhook_url", type=str, help="The webhook URL for a Slack channel.") + return parser.parse_args() + + +def main(): + args = parse_args() + text = ( + f"OLMo-core *v{VERSION}* is now out. See " + f"https://github.com/allenai/OLMo-core/releases/tag/v{VERSION} for release notes." + ) + requests.post(args.webhook_url, json={"text": text}) + + +if __name__ == "__main__": + main()