bump: version 0.5.1 → 0.6.0 #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build sdist and wheel | |
run: pipx run build | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/* | |
- name: check metadata | |
run: pipx run twine check dist/* | |
publish_dev_build: | |
needs: [build] | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://pypi.org/p/detectree | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: publish to test pypi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
release: | |
needs: [publish_dev_build] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/detectree | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
# see https://github.com/softprops/action-gh-release/issues/236 | |
contents: write | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: update changelog | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ github.token }} | |
tag: ${{ github.ref_name }} | |
- name: create Release | |
uses: ncipollo/release-action@v1.14.0 | |
with: | |
allowUpdates: true | |
draft: false | |
makeLatest: true | |
name: ${{ github.ref_name }} | |
body: ${{ steps.changelog.outputs.changes }} | |
token: ${{ github.token }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: publish to pypi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: pre-commit on changelog | |
uses: pre-commit/action@v3.0.1 | |
with: | |
extra_args: --files CHANGELOG.md | |
# we only run this to format CHANGELOG.md so pre-commit will fail (yet format it) | |
continue-on-error: true | |
- name: commit changelog | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: main | |
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' | |
file_pattern: CHANGELOG.md |