diff --git a/.cruft.json b/.cruft.json index 50d79a1..ec985e6 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sphinx-notes/cookiecutter", - "commit": "64d60218fb2be96a3293919fd233cc39acf8159f", + "commit": "d09d3031a2d20602007e1451def496c1bfad734d", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..c855b14 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,23 @@ +name: Publish package distributions to PyPI + +on: + push: + tags: + - "*" + +jobs: + pypi: + name: Publish package distributions to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/sphinxnotes-fasthtml + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - run: pip install build twine && make dist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 306d16b..ac1cdd8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,27 +1,11 @@ -name: Publish New Release +name: Publish Github Release on: push: tags: - - "*" + - "[0-9]+.[0-9]+" # MAJOR.MINOR (1.0: y, 1.0a0: n, 1.0.1: n) jobs: - pypi: - name: Publish package distributions to PyPI - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/sphinxnotes-fasthtml - permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - run: pip install build twine && make dist - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} - release: name: Publish Github Release needs: [pypi] @@ -33,4 +17,4 @@ jobs: - uses: ncipollo/release-action@v1 with: body: | - Changelog: https://sphinx.silverrainz.me/fasthtml/changelog.html#version-${{ github.ref_name }} + Changelog: https://sphinx.silverrainz.me/fasthtml/changelog.html diff --git a/Makefile b/Makefile index 5b37c2f..7f6cc07 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ LANG = en_US.UTF-8 MAKE = make PY = python3 RM = rm -rf +GIT = git # Build sphinx documentation. .PHONY: docs @@ -51,6 +52,10 @@ upload-test: dist update-template: $(PY) -m cruft update +.PHONY: update-template-done +update-template-done: + $(GIT) commit -m "chore: Update project template to sphinx-notes/cookiecutter@$(shell jq -r '.commit' .cruft.json | head -c8)" + # Update project version. .PHONY: bump-version bump-version: