Skip to content

Commit

Permalink
Revert "Re-consolidate workflows"
Browse files Browse the repository at this point in the history
This reverts commit c91f121.
  • Loading branch information
twm committed Jul 7, 2024
1 parent ac38a0e commit 62c86b4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 38 deletions.
26 changes: 26 additions & 0 deletions .github/actions/build-dist/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build incremental
description: Build and upload sdist and wheel

runs:
using: "composite"
steps:

- uses: actions/checkout@v4

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

- run: pip install build twine
shell: bash

- run: python3 -m build
shell: bash

- run: twine check dist/*.*
shell: bash

- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.*
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags: ["incremental-*"]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-24.04

steps:
- uses: ./.github/actions/build-dist

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

environment:
name: release
url: https://pypi.org/p/incremental

permissions:
id-token: write

steps:

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

- uses: pypa/gh-action-pypi-publish@release/v1
40 changes: 2 additions & 38 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# the conditions for which gh-pages are updated.
branches: [ trunk ]
tags:
- "incremental-*"
- incremental-*
pull_request:
branches: [ trunk, "90-pyproject.toml" ]

Expand All @@ -29,22 +29,7 @@ jobs:
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/*.*
- uses: ./.github/actions/build-dist

testing:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -175,24 +160,3 @@ jobs:
with:
name: html-report
path: htmlcov

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

environment:
name: release
url: https://pypi.org/p/incremental

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 62c86b4

Please sign in to comment.