Skip to content

Commit

Permalink
Update check-release.yml
Browse files Browse the repository at this point in the history
Take 3

Signed-off-by: Antony Milne <[email protected]>
  • Loading branch information
antonymilne authored Oct 26, 2023
1 parent 75ca950 commit d6ff383
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,61 +35,61 @@ jobs:
package_name: ${{ steps.version_check.outputs.package_name }}
package_version: ${{ steps.version_check.outputs.package_version }}

build-publish:
needs: [check-version]
if: |
needs.check-version.outputs.new_release == 'True'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/tools_requirements.txt
pip install hatch
- name: Extract release notes from ${{needs.check-version.outputs.package_name}}/CHANGELOG.md
id: extract
run: |
formatted_date=$(date +"%Y-%m-%d")
python tools/extract_release_notes.py \
"${{needs.check-version.outputs.package_name}}" \
"${{needs.check-version.outputs.package_version}} — $formatted_date"
- name: Tag main and create release on github
run: |
./tools/release.sh mckinsey vizro ${{ secrets.GITHUB_TOKEN }} \
${{needs.check-version.outputs.package_name}} \
${{needs.check-version.outputs.package_version}} release_body.txt
- name: Build package
run: |
cd "${{ needs.check-version.outputs.package_name }}"
hatch build
- name: Set PyPI token
run: |
if [ "${{ needs.check-version.outputs.PACKAGE_NAME }}" == "vizro-core" ]; then
echo 'PYPI_TOKEN=${{ secrets.VIZRO_PYPI_TOKEN }}' >> $GITHUB_ENV
fi
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ needs.check-version.outputs.package_name }}/dist
password: ${{ env.PYPI_TOKEN }}
- name: Check correct package uploaded to PyPI
run: |
cd "${{ needs.check-version.outputs.package_name }}/dist"
local=$(md5sum vizro-${{needs.check-version.outputs.package_version}}-py3-none-any.whl)
cd "${{ needs.check-version.outputs.package_name }}"
pip download vizro==${{needs.check-version.outputs.package_version}} -d . --no-deps --timeout 300
pypi=$(md5sum vizro-${{needs.check-version.outputs.package_version}}-py3-none-any.whl)
if [ $local = $pypi ]; then; echo "md5 hash is the same"; else; echo "md5 hash is not the same" exit 1; fi;
# build-publish:
# needs: [check-version]
# if: |
# needs.check-version.outputs.new_release == 'True'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r tools/tools_requirements.txt
# pip install hatch
# - name: Extract release notes from ${{needs.check-version.outputs.package_name}}/CHANGELOG.md
# id: extract
# run: |
# formatted_date=$(date +"%Y-%m-%d")
# python tools/extract_release_notes.py \
# "${{needs.check-version.outputs.package_name}}" \
# "${{needs.check-version.outputs.package_version}} — $formatted_date"
# - name: Tag main and create release on github
# run: |
# ./tools/release.sh mckinsey vizro ${{ secrets.GITHUB_TOKEN }} \
# ${{needs.check-version.outputs.package_name}} \
# ${{needs.check-version.outputs.package_version}} release_body.txt
# - name: Build package
# run: |
# cd "${{ needs.check-version.outputs.package_name }}"
# hatch build
# - name: Set PyPI token
# run: |
# if [ "${{ needs.check-version.outputs.PACKAGE_NAME }}" == "vizro-core" ]; then
# echo 'PYPI_TOKEN=${{ secrets.VIZRO_PYPI_TOKEN }}' >> $GITHUB_ENV
# fi
# - name: Publish distribution 📦 to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: ${{ needs.check-version.outputs.package_name }}/dist
# password: ${{ env.PYPI_TOKEN }}
# - name: Check correct package uploaded to PyPI
# run: |
# cd "${{ needs.check-version.outputs.package_name }}/dist"
# local=$(md5sum vizro-${{needs.check-version.outputs.package_version}}-py3-none-any.whl)
# cd "${{ needs.check-version.outputs.package_name }}"
# pip download vizro==${{needs.check-version.outputs.package_version}} -d . --no-deps --timeout 300
# pypi=$(md5sum vizro-${{needs.check-version.outputs.package_version}}-py3-none-any.whl)
# if [ $local = $pypi ]; then; echo "md5 hash is the same"; else; echo "md5 hash is not the same" exit 1; fi;

version-bump:
needs: [check-version]
# if: |
# needs.check-version.outputs.new_release == 'True'
if: |
needs.check-version.outputs.new_release == 'True'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit d6ff383

Please sign in to comment.