From 348a4dd6c37d77a26461ce03cd27ccc78cc933f1 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 23 Mar 2024 15:31:10 +0800 Subject: [PATCH] chore: Update cookiecutter template --- .cruft.json | 2 +- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.cruft.json b/.cruft.json index f3412e8..e9ba684 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sphinx-notes/template", - "commit": "0b7d8aa478b37114cef369a217bd1d463e369d37", + "commit": "1701bf78ca498d756ce4502aa1712cfe23ed35af", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8018728 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Publish New Release + +on: + push: + tags: + - "*" + +jobs: + pypi: + name: Publish package distributions to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/sphinxnotes-snippet + 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] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: ncipollo/release-action@v1 + with: + body: | + Changelog: https://sphinx.silverrainz.me/snippet/changelog.html#version-${{ github.ref_name }}