fix: slack link #705
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
name: release | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
outputs: | |
python_path_released: ${{ steps.parse.outputs.python_path_released }} | |
js_path_released: ${{ steps.parse.outputs.js_path_released }} | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release-please | |
- name: Parse release path | |
if: ${{ steps.release-please.outputs.releases_created == 'true' }} | |
id: parse | |
env: | |
PATHS_RELEASED: ${{ steps.release-please.outputs.paths_released }} | |
# We assume that only one path is released at a time | |
run: | | |
echo $PATHS_RELEASED | jq -r '.[0]' | while read -r PATH; do | |
case $PATH in | |
python/*) | |
echo "python_path_released=$PATH" >> $GITHUB_OUTPUT ;; | |
js/*) | |
echo "js_path_released=$PATH" >> $GITHUB_OUTPUT ;; | |
esac | |
done | |
publish-python-distribution: | |
name: Publish Python distribution | |
runs-on: ubuntu-latest | |
needs: create-release | |
if: ${{ needs.create-release.outputs.python_path_released != '' }} | |
defaults: | |
run: | |
working-directory: ${{ needs.create-release.outputs.python_path_released }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install utilities | |
run: python -m pip install hatch check_wheel_contents twine | |
- name: Build distribution | |
run: hatch build | |
- name: Check wheel contents | |
run: check-wheel-contents dist/*.whl | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: '__token__' | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
twine upload --skip-existing --verbose dist/* | |
publish-javascript-distribution: | |
name: Publish JavaScript distribution | |
runs-on: ubuntu-latest | |
needs: create-release | |
if: ${{ needs.create-release.outputs.js_path_released != '' }} | |
defaults: | |
run: | |
working-directory: ${{ needs.create-release.outputs.js_path_released }} | |
steps: | |
- uses: actions/checkout@v4 |