Merge pull request #15 from JeremieGince/dev #15
This file contains hidden or 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
| name: Build dist | |
| on: | |
| push: | |
| branches: ["main"] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| actions: write | |
| checks: write | |
| statuses: write | |
| issues: write | |
| discussions: write | |
| id-token: write | |
| jobs: | |
| Build-Dist: | |
| if: false # TODO: remove this line to enable this workflow | |
| name: Build dist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m venv ./venv | |
| . ./venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install poetry | |
| poetry install --with=dev --no-interaction --no-ansi | |
| - name: Gather new package version | |
| id: version | |
| uses: anothrNick/github-tag-action@1.61.0 | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| WITH_V: false | |
| DEFAULT_BUMP: patch | |
| DRY_RUN: true | |
| - name: Bump package version in pyproject.toml | |
| run: | | |
| . ./venv/bin/activate | |
| poetry version ${{steps.version.outputs.new_tag}} | |
| - name: Build dist | |
| run: | | |
| . ./venv/bin/activate | |
| python -m build | |
| twine check dist/* | |
| - name: Commit updated pyproject.toml | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add pyproject.toml | |
| git diff-index --quiet HEAD || git commit -m "Updating version of pyproject.toml" | |
| - name: Push the new pyproject.toml | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{secrets.GITHUB_TOKEN}} | |
| branch: main | |
| force: true | |
| - name: Create Tag | |
| id: tag | |
| uses: anothrNick/github-tag-action@1.61.0 | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| WITH_V: false | |
| DEFAULT_BUMP: patch | |
| DRY_RUN: false | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.new_tag }} | |
| generate_release_notes: true | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip_existing: true | |
| verbose: true | |
| - name: Merge 'main' branch -> 'dev' branch | |
| uses: devmasx/merge-branch@master | |
| with: | |
| type: now | |
| from_branch: main | |
| target_branch: dev | |
| message: "Automatic merge from 'main' into 'dev' [skip actions]" | |
| label_name: "gh-actions" | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |