-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade CI workflows to get them running again (#90)
* ci: update actions to latest for all workflows Signed-off-by: Paul Horton <[email protected]>
- Loading branch information
Showing
5 changed files
with
338 additions
and
258 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 |
---|---|---|
|
@@ -5,6 +5,42 @@ on: | |
branches: | ||
- master | ||
workflow_dispatch: | ||
inputs: | ||
release_force: | ||
# see https://python-semantic-release.readthedocs.io/en/latest/github-action.html#command-line-options | ||
description: | | ||
Force release be one of: [major | minor | patch] | ||
Leave empty for auto-detect based on commit messages. | ||
type: choice | ||
options: | ||
- "" # auto - no force | ||
- major # force major | ||
- minor # force minor | ||
- patch # force patch | ||
default: "" | ||
required: false | ||
prerelease_token: | ||
description: 'The "pre-release identifier" to use as a prefix for the "pre-release" part of a semver. Like the rc in `1.2.0-rc.8`.' | ||
type: choice | ||
options: | ||
- rc | ||
- beta | ||
- alpha | ||
default: rc | ||
required: false | ||
prerelease: | ||
description: "Is a pre-release" | ||
type: boolean | ||
default: false | ||
required: false | ||
|
||
concurrency: | ||
group: deploy | ||
cancel-in-progress: false # prevent duplicates semantic-release | ||
|
||
env: | ||
PYTHON_VERSION_DEFAULT: "3.9" | ||
POETRY_VERSION: "1.4.2" | ||
|
||
jobs: | ||
build-and-release: | ||
|
@@ -15,22 +51,45 @@ jobs: | |
concurrency: release | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
- name: Setup Python Environment | ||
# see https://github.com/actions/setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
python-version: ${{ env.PYTHON_VERSION_DEFAULT }} | ||
architecture: 'x64' | ||
- name: Install poetry | ||
# see https://github.com/marketplace/actions/setup-poetry | ||
uses: Gr1N/setup-poetry@v9 | ||
with: | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install poetry --upgrade pip | ||
poetry config virtualenvs.create false | ||
poetry install | ||
- name: View poetry version | ||
run: poetry --version | ||
run: poetry install --no-root | ||
|
||
- name: Python Semantic Release | ||
uses: relekang/python-semantic-release@master | ||
id: release | ||
# see https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html | ||
# see https://github.com/python-semantic-release/python-semantic-release | ||
uses: python-semantic-release/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
force: ${{ github.event.inputs.release_force }} | ||
prerelease: ${{ github.event.inputs.prerelease }} | ||
prerelease_token: ${{ github.event.inputs.prerelease_token }} | ||
|
||
- name: Publish package distributions to PyPI | ||
if: steps.release.outputs.released == 'true' | ||
# see https://github.com/pypa/gh-action-pypi-publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
if: steps.release.outputs.released == 'true' | ||
# see https://github.com/python-semantic-release/upload-to-gh-release | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.release.outputs.tag }} |
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
Oops, something went wrong.