Skip to content

Commit 166b6d5

Browse files
author
Drew Yang
committed
feat: ✨ add slack notification
1 parent 5815b81 commit 166b6d5

File tree

2 files changed

+34
-23
lines changed

2 files changed

+34
-23
lines changed

.github/workflows/post_release.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,15 @@ jobs:
3535
git config --global user.email "[email protected]"
3636
git add datajoint/version.py
3737
git commit -m "Update version.py to $VERSION"
38-
git push
38+
git push
39+
slack-notification:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Post text to a Slack channel
43+
uses: slackapi/[email protected]
44+
with:
45+
method: chat.postMessage
46+
token: ${{ secrets.SLACK_BOT_TOKEN }}
47+
payload: |
48+
channel: ${{ secrets.SLACK_CHANNEL_ID }}
49+
text: "howdy <@channel>!"

.github/workflows/release.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,28 @@ jobs:
5757
echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV
5858
echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV
5959
echo "NEW_VERSION=${{steps.create_gh_release.outputs.resolved_version}}" >> $GITHUB_ENV
60-
- name: Publish package
61-
run: |
62-
export HOST_UID=$(id -u)
63-
if [ "$TESTPYPI" == "true" ]; then
64-
LATEST_PYPI=$(curl -s https://test.pypi.org/pypi/datajoint/json | jq -r '.info.version')
65-
export TWINE_REPOSITORY="testpypi"
66-
export TWINE_USERNAME=${TWINE_TEST_USERNAME}
67-
export TWINE_PASSWORD=${TWINE_TEST_PASSWORD}
68-
else
69-
LATEST_PYPI=$(curl -s https://pypi.org/pypi/datajoint/json | jq -r '.info.version')
70-
export TWINE_REPOSITORY="pypi"
71-
fi
72-
# Check if the new version is different from the latest on PyPI, avoid re-uploading error
73-
if [ "$NEW_VERSION" != "$LATEST_PYPI" ]; then
74-
docker compose run --build --quiet-pull \
75-
-e TWINE_USERNAME=${TWINE_USERNAME} \
76-
-e TWINE_PASSWORD=${TWINE_PASSWORD} \
77-
-e TWINE_REPOSITORY=${TWINE_REPOSITORY} \
78-
app sh -c "pip install twine && python -m twine upload dist/*"
79-
else
80-
echo "::warning::Latest version $LATEST_PYPI on $TWINE_REPOSITORY is the new version $NEW_VERSION"
81-
fi
60+
# - name: Publish package
61+
# run: |
62+
# export HOST_UID=$(id -u)
63+
# if [ "$TESTPYPI" == "true" ]; then
64+
# LATEST_PYPI=$(curl -s https://test.pypi.org/pypi/datajoint/json | jq -r '.info.version')
65+
# export TWINE_REPOSITORY="testpypi"
66+
# export TWINE_USERNAME=${TWINE_TEST_USERNAME}
67+
# export TWINE_PASSWORD=${TWINE_TEST_PASSWORD}
68+
# else
69+
# LATEST_PYPI=$(curl -s https://pypi.org/pypi/datajoint/json | jq -r '.info.version')
70+
# export TWINE_REPOSITORY="pypi"
71+
# fi
72+
# # Check if the new version is different from the latest on PyPI, avoid re-uploading error
73+
# if [ "$NEW_VERSION" != "$LATEST_PYPI" ]; then
74+
# docker compose run --build --quiet-pull \
75+
# -e TWINE_USERNAME=${TWINE_USERNAME} \
76+
# -e TWINE_PASSWORD=${TWINE_PASSWORD} \
77+
# -e TWINE_REPOSITORY=${TWINE_REPOSITORY} \
78+
# app sh -c "pip install twine && python -m twine upload dist/*"
79+
# else
80+
# echo "::warning::Latest version $LATEST_PYPI on $TWINE_REPOSITORY is the new version $NEW_VERSION"
81+
# fi
8282
# Upload package as release assets
8383
- name: Upload pip wheel asset to release
8484
if: ${{ github.event.inputs.testpypi == 'false' }}

0 commit comments

Comments
 (0)