From 4145989db07fdb3468d550ce0c8a0cee6d5c6c81 Mon Sep 17 00:00:00 2001 From: Samuel Burbulla Date: Fri, 12 Apr 2024 16:17:55 +0200 Subject: [PATCH] =?UTF-8?q?Bump=20version:=200.1.0=20=E2=86=92=200.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.toml | 2 +- .github/workflows/docs.yml | 21 +++++++++++++++----- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 4 ++-- mkdocs.yml | 6 ++---- pyproject.toml | 4 ++-- 6 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.bumpversion.toml b/.bumpversion.toml index 06b310ed..13c7bf10 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.1.0" +current_version = "0.1.1" [[tool.bumpversion.files]] filename = "pyproject.toml" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2ca59af0..1fe3c57c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,7 +2,9 @@ name: Documentation on: push: - branches: [main] + branches: [main, feature/release-pipeline] + release: + types: [published] permissions: contents: write @@ -15,13 +17,11 @@ jobs: uses: actions/checkout@v4 with: lfs: "true" + fetch-depth: 0 # fetch all commits/branches - name: Configure Git Credentials run: | git config user.name github-actions[bot] git config user.email github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v4 - with: - python-version: 3.11 - name: Setup Python uses: actions/setup-python@v5 with: @@ -30,4 +30,15 @@ jobs: - name: Install run: | pip install ".[dev]" - - run: mkdocs gh-deploy --force + - name: Get Current Version + if: ${{ github.event_name == 'release' }} + run: | + export CURRENT_VERSION=$(bump-my-version show current_version) + echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV + shell: bash + - name: Publish release + if: ${{ github.event_name == 'release' }} + run: mike deploy --push --update-aliases ${{ env.CURRENT_VERSION }} latest + - name: Publish latest + if: ${{ github.event_name == 'push' }} + run: mike deploy development --push diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..1095177e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Publish package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + concurrency: + group: publish + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: "true" + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + cache: "pip" + - name: Install + run: | + pip install ".[dev]" + - name: Get Current Version + run: | + export CURRENT_VERSION=$(bump-my-version show current_version) + echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV + shell: bash + - name: Build and publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python3 -m pip install --upgrade build twine + python3 -m build + python3 -m twine upload --verbose --non-interactive dist/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06699b53..5d31375e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,14 +150,14 @@ This applies a simple CSS-filter to the output image of the cell. ## Release process In order to create a new release, make sure that the project's venv is active -and the repository is on the main branch (including no untracked files). +and the repository is clean and on the main branch. Create a new release using the script `build_scripts/release.sh`. This script will create a release tag on the repository and bump the version number: ```shell -./build_scripts/release.sh 0.1.0 +./build_scripts/release.sh ``` Afterwards, create a GitHub release for that tag. That will a trigger a CI diff --git a/mkdocs.yml b/mkdocs.yml index 1fcbce83..959595bd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -37,7 +37,6 @@ plugins: - search - section-index - alias: - use_relative_link: true verbose: true - gen-files: scripts: @@ -131,12 +130,11 @@ extra: copyright_link: https://appliedai-institute.de version: provider: mike - default: stable social: - icon: fontawesome/brands/github link: https://github.com/aai-institute/continuiti - # - icon: fontawesome/brands/python - # link: https://pypi.org/project/continuiti/ + - icon: fontawesome/brands/python + link: https://pypi.org/project/continuiti/ - icon: fontawesome/brands/twitter link: https://twitter.com/appliedAI_gGmbH - icon: fontawesome/brands/linkedin diff --git a/pyproject.toml b/pyproject.toml index 97bc25a9..8a7cdb12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ keywords = [ "Artificial Intelligence", "Machine Learning", "Mathematics", "Physics", "Operator Learning", "Physics-Informed ML", "Neural Operator", "DeepONet", ] -version = "0.1.0" +version = "0.1.1" dependencies = [ "black", # code formatting "flake8", # code analysis @@ -77,7 +77,7 @@ dev = [ [tool.setuptools.packages.find] where = ["src"] -include = ["continuiti"] +include = ["continuiti*"] [project.urls] Repository = "https://github.com/aai-institute/continuiti.git"