diff --git a/.github/workflows/simod.yml b/.github/workflows/simod.yml index c71d4e33..6ab98941 100644 --- a/.github/workflows/simod.yml +++ b/.github/workflows/simod.yml @@ -115,11 +115,13 @@ jobs: platforms: linux/amd64,linux/arm64 release-pypi: + name: Release, Python ${{ matrix.python-version }} needs: [ test ] runs-on: ubuntu-latest - outputs: - version: ${{ steps.versioning.outputs.version }} - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + strategy: + matrix: + python-version: [ '3.9' ] environment: name: PyPI url: https://pypi.org/p/simod @@ -128,27 +130,37 @@ jobs: contents: write packages: write steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Install poetry + shell: bash run: pip install poetry + - name: Install project + run: | + poetry install + - name: Build - run: poetry install && poetry build + run: | + poetry build - - name: Generate licenses.md + - name: Get version + id: get_version run: | - poetry run pip install pip-licenses - poetry run pip-licenses --with-system --with-urls --format=markdown --output-file=licenses.md + echo "version=$(poetry version --short)" >> "$GITHUB_OUTPUT" - - name: Upload licenses.md - uses: actions/upload-artifact@v4 + - name: Upload artifacts + uses: actions/upload-artifact@v3 with: - name: licenses.md - path: licenses.md + name: simod-${{ steps.get_version.outputs.version }}-py${{ matrix.python-version }} + path: dist - name: Generate changelog run: | @@ -159,24 +171,18 @@ jobs: echo "" >> CHANGELOG.md echo "\`\`\`" >> CHANGELOG.md - - name: Get the version - id: versioning - run: echo "version=$(poetry version --short)" >> "$GITHUB_OUTPUT" - - - name: Assign a version tag if not present + - name: Assign repository tag run: | - if ! git rev-parse ${{ steps.versioning.outputs.version }}; then - git tag ${{ steps.versioning.outputs.version }} - git push --tags - fi + git tag ${{ steps.get_version.outputs.version }} + git push --tags - - name: Create a release if needed + - name: Create release uses: softprops/action-gh-release@v1 with: files: | dist/* - tag_name: ${{ steps.versioning.outputs.version }} + tag_name: ${{ steps.get_version.outputs.version }} body_path: CHANGELOG.md - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 7b52b757..e0de215b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "simod" -version = "5.0.2" +version = "5.1.0" authors = [ "Ihar Suvorau ", "David Chapela ",