Skip to content

Commit

Permalink
fix(ci): publish to pypi with poetry (#429)
Browse files Browse the repository at this point in the history
* chore(deps): Bump mkdocs-material from 9.5.32 to 9.5.39 (#409)

Bumps [mkdocs-material](/~https://github.com/squidfunk/mkdocs-material) from 9.5.32 to 9.5.39.
- [Release notes](/~https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](/~https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@9.5.32...9.5.39)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump ruff from 0.6.1 to 0.6.8 (#408)

Bumps [ruff](/~https://github.com/astral-sh/ruff) from 0.6.1 to 0.6.8.
- [Release notes](/~https://github.com/astral-sh/ruff/releases)
- [Changelog](/~https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.6.1...0.6.8)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump mkdocstrings-python from 1.10.8 to 1.11.1 (#397)

Bumps [mkdocstrings-python](/~https://github.com/mkdocstrings/python) from 1.10.8 to 1.11.1.
- [Release notes](/~https://github.com/mkdocstrings/python/releases)
- [Changelog](/~https://github.com/mkdocstrings/python/blob/main/CHANGELOG.md)
- [Commits](mkdocstrings/python@1.10.8...1.11.1)

---
updated-dependencies:
- dependency-name: mkdocstrings-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump mkdocs from 1.6.0 to 1.6.1 (#390)

Bumps [mkdocs](/~https://github.com/mkdocs/mkdocs) from 1.6.0 to 1.6.1.
- [Release notes](/~https://github.com/mkdocs/mkdocs/releases)
- [Commits](mkdocs/mkdocs@1.6.0...1.6.1)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump cryptography from 43.0.0 to 43.0.1 (#395)

Bumps [cryptography](/~https://github.com/pyca/cryptography) from 43.0.0 to 43.0.1.
- [Changelog](/~https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@43.0.0...43.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump poetry-plugin-dotenv from 2.2.3 to 2.4.0 (#396)

Bumps [poetry-plugin-dotenv](/~https://github.com/pivoshenko/poetry-plugin-dotenv) from 2.2.3 to 2.4.0.
- [Release notes](/~https://github.com/pivoshenko/poetry-plugin-dotenv/releases)
- [Changelog](/~https://github.com/pivoshenko/poetry-plugin-dotenv/blob/main/CHANGELOG.md)
- [Commits](pivoshenko/poetry-plugin-dotenv@v2.2.3...v2.4.0)

---
updated-dependencies:
- dependency-name: poetry-plugin-dotenv
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump ruff from 0.6.8 to 0.7.4 (#420)

Bumps [ruff](/~https://github.com/astral-sh/ruff) from 0.6.8 to 0.7.4.
- [Release notes](/~https://github.com/astral-sh/ruff/releases)
- [Changelog](/~https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.6.8...0.7.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump mkdocs-material from 9.5.39 to 9.5.45 (#422)

Bumps [mkdocs-material](/~https://github.com/squidfunk/mkdocs-material) from 9.5.39 to 9.5.45.
- [Release notes](/~https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](/~https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@9.5.39...9.5.45)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(ci): publish to pypi with poetry

* ci: upgrade checkout to v4

* ci: migrate to new step output system

* docs: update python versions

* ci: cleanup previous dev pypi release

* ci: cleanup previous dev pypi release

* ci: cleanup previous dev pypi release

* ci: cleanup previous dev pypi release

* ci: cleanup previous dev pypi release

* ci: apply on master branch

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
germainlefebvre4 and dependabot[bot] committed Dec 2, 2024
1 parent 53638ac commit 52305ec
Show file tree
Hide file tree
Showing 10 changed files with 886 additions and 820 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
name: Check compliance
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1

lint-mkdocs:
name: Lint mkdocs files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v11
with:
glob: 'docs/*.md'
108 changes: 56 additions & 52 deletions .github/workflows/release-feat-dryrun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:
- develop
- feat/*
- fix/*
- ci/*

jobs:
release:
runs-on: ubuntu-latest
outputs:
new_release_version: ${{ steps.version.outputs.new_release_version }}
new_release_published: ${{ steps.version.outputs.new_release_published }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Semantic Release Config
run: |
Expand All @@ -25,77 +29,77 @@ jobs:
}
'> .releaserc
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
branches: 'master'
semantic_version: 19.0.2
branches: ${{ github.head_ref || github.ref_name }}
semantic_version: 21.1.1
extra_plugins: |
@semantic-release/commit-analyzer@9.0.2
@semantic-release/github@8.0.2
dry_run: true
ci: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: set release_version
id: set_release_version
uses: noobly314/share-data@v1
with:
share-id: release_version
mode: set
key: version
value: ${{ steps.semantic.outputs.new_release_version }}
- name: set release_published
id: set_release_published
uses: noobly314/share-data@v1
with:
share-id: release_published
mode: set
key: is_published
value: ${{ steps.semantic.outputs.new_release_published }}

- name: Write in summary
run: |
echo "## Semantic Release" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "new_release_version: $NEW_RELEASE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "new_release_published: $NEW_RELEASE_PUBLISHED" >> $GITHUB_STEP_SUMMARY
env:
NEW_RELEASE_VERSION: ${{ steps.semantic.outputs.new_release_version }}
NEW_RELEASE_PUBLISHED: ${{ steps.semantic.outputs.new_release_published }}

- name: Write in outputs
id: version
run: |
echo "NEW_RELEASE_VERSION=$NEW_RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "NEW_RELEASE_PUBLISHED=$NEW_RELEASE_PUBLISHED" >> $GITHUB_OUTPUT
env:
NEW_RELEASE_VERSION: ${{ steps.semantic.outputs.new_release_version }}
NEW_RELEASE_PUBLISHED: ${{ steps.semantic.outputs.new_release_published }}


deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'

- name: get release_version
id: release_version
uses: noobly314/share-data@v1
uses: actions/setup-python@v5
with:
share-id: release_version
mode: get
key: version
- name: get release_published
id: release_published
uses: noobly314/share-data@v1
with:
share-id: release_published
mode: get
key: is_published
python-version: '3.11'

- name: Update package version
run: |
echo ${{ steps.release_version.outputs.data }}
sed "s/^\( *version=\).*/\1'${{ steps.release_version.outputs.data }}',/g" setup.py
sed -i "s/^\( *version=\).*/\1'${{ steps.release_version.outputs.data }}',/g" setup.py
if: steps.release_published.outputs.data == 'true'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
if: steps.release_published.outputs.data == 'true'
pip install poetry
- name: Update package version
id: update_version
run: |
sha_short=$(git rev-parse --short HEAD)
bump_version="${{ needs.release.outputs.new_release_version }}.dev${{ github.run_number }}"
echo "bump_version=$bump_version" >> $GITHUB_OUTPUT
echo "bump_version: $bump_version" >> $GITHUB_STEP_SUMMARY
echo $bump_version
poetry version $bump_version
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_TEST_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }}
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi $PYPI_TEST_TOKEN
poetry build
poetry publish -r test-pypi
if: needs.release.outputs.new_release_published == 'true'

- name: Clean PyPi release
if: always()
run: |
python setup.py sdist bdist_wheel
twine upload --repository testpypi dist/*
if: steps.release_published.outputs.data == 'true'
poetry add pypi-cleanup
poetry run pypi-cleanup --host https://test.pypi.org --username '__token__' --package libtado --do-it
env:
PYPI_CLEANUP_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
96 changes: 47 additions & 49 deletions .github/workflows/release-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
jobs:
release:
runs-on: ubuntu-latest
outputs:
new_release_version: ${{ steps.version.outputs.new_release_version }}
new_release_published: ${{ steps.version.outputs.new_release_published }}
steps:
- uses: actions/checkout@v1

Expand All @@ -25,11 +28,11 @@ jobs:
}
'> .releaserc
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
branches: 'master'
semantic_version: 19.0.2
semantic_version: 21.1.1
extra_plugins: |
@semantic-release/commit-analyzer@9.0.2
@semantic-release/release-notes-generator@10.0.3
Expand All @@ -38,64 +41,59 @@ jobs:
dry_run: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: set release_version
id: set_release_version
uses: noobly314/share-data@v1
with:
share-id: release_version
mode: set
key: version
value: ${{ steps.semantic.outputs.new_release_version }}
- name: set release_published
id: set_release_published
uses: noobly314/share-data@v1
with:
share-id: release_published
mode: set
key: version
value: ${{ steps.semantic.outputs.new_release_published }}

- name: Write in summary
run: |
echo "## Semantic Release" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "new_release_version: $NEW_RELEASE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "new_release_published: $NEW_RELEASE_PUBLISHED" >> $GITHUB_STEP_SUMMARY
env:
NEW_RELEASE_VERSION: ${{ steps.semantic.outputs.new_release_version }}
NEW_RELEASE_PUBLISHED: ${{ steps.semantic.outputs.new_release_published }}

- name: Write in outputs
id: version
run: |
echo "NEW_RELEASE_VERSION=$NEW_RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "NEW_RELEASE_PUBLISHED=$NEW_RELEASE_PUBLISHED" >> $GITHUB_OUTPUT
env:
NEW_RELEASE_VERSION: ${{ steps.semantic.outputs.new_release_version }}
NEW_RELEASE_PUBLISHED: ${{ steps.semantic.outputs.new_release_published }}

deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.11'

- name: get release_version
id: release_version
uses: noobly314/share-data@v1
with:
share-id: release_version
mode: get
key: version
- name: get release_published
id: release_published
uses: noobly314/share-data@v1
with:
share-id: release_published
mode: get
key: version

- name: Update package version
run: |
sed -i "s/^\( *version=\).*/\1'${{ steps.release_version.outputs.data }}',/g" setup.py
sed -i 's/^\(^version = \).*/\1"${{ steps.release_version.outputs.data }}",/g' pyproject.toml
if: steps.release_published.outputs.data == 'true'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
if: steps.release_published.outputs.data == 'true'
pip install poetry
if: needs.release.outputs.new_release_published == 'true'

- name: Update package version
id: update_version
run: |
sha_short=$(git rev-parse --short HEAD)
bump_version="${{ needs.release.outputs.new_release_version }}"
echo "bump_version=$bump_version" >> $GITHUB_OUTPUT
echo "bump_version: $bump_version" >> $GITHUB_STEP_SUMMARY
echo $bump_version
poetry version $bump_version
if: needs.release.outputs.new_release_published == 'true'

- name: Build and publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
if: steps.release_published.outputs.data == 'true'
poetry config repositories.pypi https://pypi.org
poetry config pypi-token.pypi $PYPI_TOKEN
poetry build
poetry publish -r pypi
if: needs.release.outputs.new_release_published == 'true'
2 changes: 1 addition & 1 deletion .github/workflows/template_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ It shows you how to use the library and expose some structured responses. A more
| `3.8` | `3.7.0` > `latest` |
| `3.9` | `3.7.0` > `latest` |
| `3.10` | `3.7.0` > `latest` |
| `3.11` | `3.7.0` > `latest` |
| `3.12` | `3.7.0` > `latest` |

## Contributing

Expand Down
Loading

0 comments on commit 52305ec

Please sign in to comment.