Merge pull request #10 from JeremieGince/dev #11
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 | |
| 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}} | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add pyproject.toml | |
| 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: Build dist | |
| run: | | |
| . ./venv/bin/activate | |
| python -m build | |
| - name: Commit the new dist | |
| run: | | |
| git add -f dist | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git commit -m "Update dist" | |
| - name: Push the new dist | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{secrets.GITHUB_TOKEN}} | |
| branch: main | |
| force: true | |
| directory: dist | |
| - 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 |