-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New fully automated process to build/tag/release (GitHub) & publish (…
…PyPi) versions (#1324)
- Loading branch information
1 parent
2efe244
commit 4b4ba4c
Showing
3 changed files
with
87 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: CD | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
description: "Dry-run" | ||
required: true | ||
default: true | ||
version: | ||
description: "SemVer string for new version" | ||
required: true | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: protected | ||
steps: | ||
- name: Checkout code repository | ||
uses: actions/checkout@v4 | ||
- name: Build Python packages | ||
uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
tag: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: protected | ||
permissions: | ||
contents: write | ||
outputs: | ||
new_tag: ${{ steps.tag_version.outputs.new_tag }} | ||
changelog: ${{ steps.tag_version.outputs.changelog }} | ||
steps: | ||
- name: Checkout code repository | ||
uses: actions/checkout@v4 | ||
- name: Tag new version | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ github.token }} | ||
default_bump: "false" | ||
custom_tag: ${{ inputs.version }} | ||
tag_prefix: "" | ||
dry_run: ${{ inputs.dry-run }} | ||
|
||
release: | ||
needs: | ||
- build | ||
- tag | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: protected | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download built Python packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
- name: Create GitHub Release with Python packages | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: dist/* | ||
tag: ${{ needs.tag.outputs.new_tag }} | ||
body: ${{ needs.tag.outputs.changelog }} | ||
draft: ${{ inputs.dry-run }} | ||
|
||
publish: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
if: ${{ ! inputs.dry-run }} | ||
environment: | ||
name: publish | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download built Python package | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
File renamed without changes.