-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e74729b
commit 7ca9041
Showing
3 changed files
with
21 additions
and
42 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,60 +1,30 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
force-pypi: | ||
description: Force PyPI | ||
type: boolean | ||
required: false | ||
default: false | ||
force-github: | ||
description: Force GitHub | ||
type: boolean | ||
required: false | ||
default: false | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
name: Release to PyPI | ||
runs-on: ubuntu-latest | ||
concurrency: release | ||
if: github.repository == 'kalekundert/parametrize_from_file' | ||
|
||
environment: | ||
name: release | ||
|
||
concurrency: release | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Make sure the whole repository history is present, so that | ||
# python-semantic-release can decide if a new release is needed. | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Update version | ||
id: semantic-release | ||
uses: python-semantic-release/[email protected] | ||
- uses: python-semantic-release/[email protected] | ||
id: release | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build sdist/wheel | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
- name: Upload to PyPI | ||
if: inputs.force-pypi || steps.semantic-release.outputs.released == 'true' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
|
||
- name: Upload to GitHub | ||
if: inputs.force-github || steps.semantic-release.outputs.released == 'true' | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
- uses: python-semantic-release/upload-to-gh-release@main | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,5 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.4 | ||
hooks: | ||
- id: ruff |
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