diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ce765b7..1a7abfd 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,8 +1,10 @@ name: Publish Package on: - release: - types: [created] + # release: + # types: [created] + push: + branches: ["main"] jobs: publish: @@ -28,15 +30,25 @@ jobs: - name: Install uv uses: yezz123/setup-uv@v4 id: install-uv + + - name: Export version + id: export-version + run: | + VERSION=$(uvx dunamai from any --no-metadata --style pep440).$(date +"%Y%m%d") + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Bump version + uses: sebasptsch/toml-edit-action@v1.3.0 + with: + path: "pyproject.toml" + key: "version" + value: "${{ steps.export-version.outputs.version }}" - name: Build package run: | - VERSION=$(uvx dunamai from any --no-metadata --style pep440).$(date +"%Y%m%d") - echo $VERSION - sed -i'' -E "s/version = \"0.0.0\"/version = \"$VERSION\"/g" pyproject.toml uvx --from build pyproject-build --installer uv - - name: Release to PyPI - run: | - uvx twine upload dist/* --non-interactive \ - --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + # - name: Release to PyPI + # run: | + # uvx twine upload dist/* --non-interactive \ + # --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file