Skip to content

Commit

Permalink
ci: update actions to latest for all workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <paul.horton@owasp.org>
  • Loading branch information
madpah committed Mar 27, 2024
1 parent 1ce9236 commit fd37bec
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 24 deletions.
83 changes: 73 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -15,22 +51,49 @@ 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
- name: Install dependencies
run: |
python -m pip install poetry --upgrade pip
poetry config virtualenvs.create false
poetry install
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: View poetry version
run: poetry --version
- name: Install dependencies
run: |
# poetry config virtualenvs.create false
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/python-semantic-release@v9.1.1
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 }}
28 changes: 14 additions & 14 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:

env:
REPORTS_DIR: CI_reports
PYTHON_VERISON_DEFAULT: "3.10"
POETRY_VERSION: "1.1.11"
PYTHON_VERSION_DEFAULT: "3.10"
POETRY_VERSION: "1.4.2"

jobs:
coding-standards:
Expand All @@ -24,16 +24,16 @@ jobs:
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERISON_DEFAULT }}
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v7
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install dependencies
Expand All @@ -57,16 +57,16 @@ jobs:
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v7
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install dependencies
Expand Down Expand Up @@ -95,28 +95,28 @@ jobs:
os: 'ubuntu-latest'
python-version: '3.6'
toxenv: 'lowest'
timeout-minutes: 30
timeout-minutes: 15
steps:
- name: Disabled Git auto EOL CRLF transforms
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Create reports directory
run: mkdir ${{ env.REPORTS_DIR }}
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Validate Python Environment
run: echo "import sys; print('Python %s on %s in %s' % (sys.version, sys.platform, sys.getdefaultencoding()))" | python
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v7
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install dependencies
Expand All @@ -133,7 +133,7 @@ jobs:
- name: Artifact reports
if: ${{ ! cancelled() }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPORTS_ARTIFACT }}
path: ${{ env.REPORTS_DIR }}
Expand Down

0 comments on commit fd37bec

Please sign in to comment.