diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 6c288ad26..b0dd084ad 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -69,8 +69,10 @@ jobs: 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 + if [ "${{ needs.check-version.outputs.package_name }}" == "vizro-core" ]; then + echo 'PYPI_TOKEN=${{ secrets.VIZRO_PYPI_TOKEN }}' >> $GITHUB_ENV + elif [ "${{ needs.check-version.outputs.package_name }}" == "vizro-ai" ]; then + echo 'PYPI_TOKEN=${{ secrets.VIZRO_AI_PYPI_TOKEN }}' >> $GITHUB_ENV fi - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 @@ -80,10 +82,10 @@ jobs: - 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) + local=$(md5sum ${{ needs.check-version.outputs.package_name }}-${{needs.check-version.outputs.package_version}}-py3-none-any.whl) cd .. - 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) + pip download ${{ needs.check-version.outputs.package_name }}==${{needs.check-version.outputs.package_version}} -d . --no-deps --timeout 300 + pypi=$(md5sum ${{ needs.check-version.outputs.package_name }}-${{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: diff --git a/tools/check_package_release.py b/tools/check_package_release.py index a501080ff..2fcbf17c4 100644 --- a/tools/check_package_release.py +++ b/tools/check_package_release.py @@ -5,7 +5,7 @@ import requests -AVAILABLE_PACKAGES = ["vizro-core"] +AVAILABLE_PACKAGES = ["vizro-core", "vizro-ai"] VERSION_MATCHSTR = r'\s*__version__\s*=\s*"(\d+\.\d+\.\d+)"' RESPONSE_ERROR = 404 diff --git a/tools/release.sh b/tools/release.sh index 1e58b4420..6468d7949 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -13,14 +13,23 @@ GITHUB_ENDPOINT="https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/rele BODY=$(jq -Rs . < "$BODY_PATH") +if [ "$PACKAGE" = "vizro-core" ]; then + TAG_NAME="${VERSION}" + MAKE_LATEST=true +else + TAG_NAME="${PACKAGE}-${VERSION}" + MAKE_LATEST=false +fi + PAYLOAD=$(cat <<-END { - "tag_name": "${VERSION}", + "tag_name": "${TAG_NAME}", "target_commitish": "main", "name": "${PACKAGE}-${VERSION}", "body": ${BODY}, "draft": false, - "prerelease": false + "prerelease": false, + "make_latest": "${MAKE_LATEST}" } END ) @@ -32,3 +41,5 @@ STATUS=$(curl -L \ -H "X-GitHub-Api-Version: 2022-11-28" \ ${GITHUB_ENDPOINT} \ -d "${PAYLOAD}") + +echo "${STATUS}" diff --git a/vizro-ai/changelog.d/20231031_102652_anna_xiong_vizro_ai_open_source_initial_commits.md b/vizro-ai/changelog.d/20231031_102652_anna_xiong_vizro_ai_open_source_initial_commits.md index 6253ca680..aad6d0ef3 100644 --- a/vizro-ai/changelog.d/20231031_102652_anna_xiong_vizro_ai_open_source_initial_commits.md +++ b/vizro-ai/changelog.d/20231031_102652_anna_xiong_vizro_ai_open_source_initial_commits.md @@ -6,7 +6,7 @@ Uncomment the section that is right (remove the HTML comment wrapper). ### Highlights ✨ -- Initial release of vizro-ai package. Vizro-AI is a tool for generating data visualizations. ([#138](https://github.com/mckinsey/vizro/pull/138)) +- Initial release of `vizro-ai` package. Vizro-AI is a tool for generating data visualizations. ([#138](https://github.com/mckinsey/vizro/pull/138)) + + + + + + + + diff --git a/vizro-ai/hatch.toml b/vizro-ai/hatch.toml index a83f6efd0..a45091ddf 100644 --- a/vizro-ai/hatch.toml +++ b/vizro-ai/hatch.toml @@ -6,7 +6,7 @@ python = ["3.9", "3.10", "3.11"] [envs.changelog] dependencies = ["scriv"] detached = true -scripts = {add = "scriv create --add"} +scripts = {add = "scriv create --add", collect = ["scriv collect --add", "- hatch run lint:lint --files=CHANGELOG.md > /dev/null"]} [envs.default] dependencies = [ @@ -33,7 +33,7 @@ cov-report = [ lint = "hatch run lint:lint {args:--all-files}" prep-release = [ "hatch version release", - "hatch run changelog:scriv collect --add", + "hatch run changelog:collect", "hatch run changelog:add", 'echo "Now raise a PR to merge into main with title: Release of vizro-ai $(hatch version)"' ] diff --git a/vizro-ai/src/vizro_ai/__init__.py b/vizro-ai/src/vizro_ai/__init__.py index 12f83fd32..6dd20f43e 100644 --- a/vizro-ai/src/vizro_ai/__init__.py +++ b/vizro-ai/src/vizro_ai/__init__.py @@ -5,6 +5,6 @@ __all__ = ["VizroAI"] -__version__ = "0.1.0.dev2" +__version__ = "0.1.0.dev3" logging.basicConfig(level=os.getenv("VIZRO_AI_LOG_LEVEL", "INFO"))