Skip to content

chore: Update .github/workflows/release.yml #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
# cspell:ignore mislav
name: release

"on":
on:
release:
types: [published]
workflow_dispatch:

jobs:
pypi:
name: Publish to PyPI registry
release:
environment: release
runs-on: ubuntu-22.04
permissions:
Expand All @@ -18,13 +15,12 @@ jobs:
env:
FORCE_COLOR: 1
PY_COLORS: 1
TOXENV: pkg

steps:
- name: Switch to using Python 3.10 by default
- name: Switch to using Python 3.12 by default
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install tox
run: python3 -m pip install --user "tox>=4.0.0"
Expand All @@ -33,12 +29,20 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed by setuptools-scm
submodules: true

- name: Build dists
run: python -m tox
run: python3 -m tox -e pkg

- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1

forum_post:
needs: release
runs-on: ubuntu-22.04

steps:
- name: Retreive the forum post script from team-devtools
run: curl -O https://raw.githubusercontent.com/ansible/team-devtools/main/.github/workflows/forum_post.py

- name: Run the forum post script
run: python3 forum_post.py ${{ github.event.repository.full_name }} ${{ github.event.release.tag_name }} ${{ secrets.FORUM_KEY }} ${{ secrets.FORUM_USER }}
Loading