forked from airbus/decomon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update decomon install in tutorials when publishing a release
- By default, tutorials (in colab) install dev version of decomon - When publishing a release, we modify the notebooks to install the release version, by replacing "git+https://github.com/airbus/decomon@main#egg=decomon" - Then we push a new tag named "tutorials-vx.y.z" (if release is named "vx.y.z"). - In the release doc, the github and colab links for tutorials will point to this new tag, so that the proper version of decomon is used.
- Loading branch information
Showing
2 changed files
with
75 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ on: | |
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
package_version: ${{ steps.get_package_version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
|
@@ -20,6 +22,13 @@ jobs: | |
- name: Build package | ||
run: | | ||
python -m build | ||
- name: get package version and save it | ||
id: get_package_version | ||
run: | | ||
wheelfile=$(ls ./dist/decomon*.whl) | ||
version=$(python -c "print('$wheelfile'.split('-')[1])") | ||
echo "version=$version" | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
- name: Upload as build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -41,8 +50,38 @@ jobs: | |
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
update-tutorials-for-colab: | ||
needs: [deploy] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tuto-tag-name: ${{ steps.push-tuto-release-tag.outputs.new_tag_name }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: replace decomon version to install in notebooks | ||
run: | | ||
version=${{ needs.deploy.outputs.package_version }} | ||
old_pip_spec_pattern="\(pip.*install.*\)git+https.*egg=decomon" | ||
new_pip_spec_pattern="\1decomon==$version" | ||
sed -i -e "s|${old_pip_spec_pattern}|${new_pip_spec_pattern}|" tutorials/*.ipynb | ||
- name: push it on a dedicated tag | ||
id: push-tuto-release-tag | ||
run: | | ||
current_tag_name=${GITHUB_REF/refs\/tags\//} # stripping refs/tags/ | ||
new_tag_name="tutorials-${current_tag_name}" | ||
echo ${new_tag_name} | ||
git config user.name "Actions" | ||
git config user.email "[email protected]" | ||
git commit tutorials/*.ipynb -m "Install appropriate version of decomon" | ||
git tag ${new_tag_name} -m "Release ${current_tag_name} + installation in tutorials updated" | ||
git push origin ${new_tag_name} | ||
# store new tag name | ||
echo "new_tag_name=${new_tag_name}" >> $GITHUB_OUTPUT | ||
build-doc: | ||
uses: ./.github/workflows/build-doc.yml | ||
with: | ||
notebooks-branch: ${{ needs.update-tutorials-for-colab.outputs.tuto-tag-name }} | ||
needs: ["update-tutorials-for-colab"] | ||
|
||
deploy-doc: | ||
needs: [build-doc, deploy] | ||
|