Skip to content

Commit

Permalink
action test
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Aug 25, 2024
1 parent af63ec3 commit c2e3195
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Publish Package

on:
release:
types: [created]
# release:
# types: [created]
push:
branches: ["main"]

jobs:
publish:
Expand All @@ -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 }}
# - name: Release to PyPI
# run: |
# uvx twine upload dist/* --non-interactive \
# --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit c2e3195

Please sign in to comment.