Skip to content

Commit

Permalink
Add a release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
twm committed Sep 18, 2024
1 parent bbf9114 commit fb683a2
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:

jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.12"

- uses: actions/cache@v4
with:
Expand All @@ -34,15 +34,15 @@ jobs:
TOX_PARALLEL_NO_SPINNER: 1

docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- uses: actions/cache@v4
with:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
tags: [ "treq-*" ]
pull_request:
branches: [ trunk ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- run: pip install build twine

- run: python3 -m build

- run: twine check dist/*.*

- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.*
if-no-files-found: error

pypi-publish:
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/treq-')
needs: [build]

environment:
name: PyPI.org
url: https://pypi.org/project/treq

permissions:
id-token: write

steps:

- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit fb683a2

Please sign in to comment.