Skip to content

Commit

Permalink
improved publish release actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Jan 23, 2023
1 parent 487fd49 commit aa29629
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-cache-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build Linux dependencies

on:
push:
branches: [master]
paths:
- 'libheif/linux/**'
- 'libheif/linux_*.py'
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/publish-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
run: |
RELEASE_VERSION=$(sed -n "s/^__version__.*\"\(.*\)\"$/\\1/p" ./pillow_heif/_version.py)
echo RELEASE_TAG="v$RELEASE_VERSION" >> $GITHUB_ENV
CHANGELOG=$(grep -oPz "(?s)##\s\[$RELEASE_VERSION.+?(?=##\s\[|$)" ./CHANGELOG.md | tr -d '\0' | sed /^$/d | sed '1d')
CHANGELOG=$(echo "$CHANGELOG" | sed '$!N;s/^###.*\n#/#/;P;D' | sed '$!N;s/^###.*\n#/#/;P;D' | sed '${/^###/d;}')
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Pillow-Heif sdist and wheels
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -59,6 +64,12 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_PI_HEIF }}

- uses: rickstaa/action-create-tag@v1
- name: Create release draft
uses: ncipollo/[email protected]
with:
name: ${{ env.RELEASE_TAG }}
tag: ${{ env.RELEASE_TAG }}
commit: ${{ github.ref }}
draft: false
body: ${{ env.CHANGELOG }}
token: ${{ secrets.PAT_PH }}
25 changes: 8 additions & 17 deletions .github/workflows/test-wheels-pi_heif.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: Wheels test • Pi-Heif

on:
workflow_dispatch:
workflow_run:
workflows: [Publish]
types:
- completed
release:
types: [ published ]

jobs:
docker-tests:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • ${{ matrix.i['os'] }} • ${{ matrix.i['ver'] }} • ${{ matrix.i['arch'] }}
name: ${{ matrix.i['os'] }} • ${{ matrix.i['ver'] }} • ${{ matrix.i['arch'] }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -72,8 +68,7 @@ jobs:
-f docker/test_wheels.Dockerfile .
windows-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • Windows • 2019 • ${{ matrix.python-version }}
name: Windows • 2019 • ${{ matrix.python-version }}
runs-on: windows-2019
strategy:
matrix:
Expand Down Expand Up @@ -104,8 +99,7 @@ jobs:
cd .. && python3 -m pytest -rs pillow_heif
macos-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • macOS • 11 • ${{ matrix.python-version }}
name: macOS • 11 • ${{ matrix.python-version }}
runs-on: macos-11
strategy:
matrix:
Expand Down Expand Up @@ -140,8 +134,7 @@ jobs:
cd .. && python3 -m pytest -rs pillow_heif
manylinux-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • Ubuntu-Focal • ${{ matrix.python-version }}
name: Ubuntu-Focal • ${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
Expand Down Expand Up @@ -175,8 +168,7 @@ jobs:
cd .. && python3 -m pytest -rs pillow_heif
macos-projects-together:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • macOS • Together • ${{ matrix.python-version }}
name: macOS • Together • ${{ matrix.python-version }}
runs-on: macos-12
strategy:
matrix:
Expand Down Expand Up @@ -211,8 +203,7 @@ jobs:
cd .. && python3 -m pytest -rs pillow_heif
linux-projects-together:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • Linux • Together • ${{ matrix.python-version }}
name: Linux • Together • ${{ matrix.python-version }}
runs-on: ubuntu-22.04
strategy:
matrix:
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/test-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: Wheels test

on:
workflow_dispatch:
workflow_run:
workflows: [Publish]
types:
- completed
release:
types: [ published ]

jobs:
docker-tests:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • ${{ matrix.i['os'] }} • ${{ matrix.i['ver'] }} • ${{ matrix.i['arch'] }}
name: ${{ matrix.i['os'] }} • ${{ matrix.i['ver'] }} • ${{ matrix.i['arch'] }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -79,8 +75,7 @@ jobs:
-f docker/test_wheels.Dockerfile .
windows-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • Windows • 2019 • ${{ matrix.python-version }}
name: Windows • 2019 • ${{ matrix.python-version }}
runs-on: windows-2019
strategy:
matrix:
Expand Down Expand Up @@ -109,8 +104,7 @@ jobs:
run: cd .. && python3 -m pytest -rs pillow_heif

macos-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • macOS • 11 • ${{ matrix.python-version }}
name: macOS • 11 • ${{ matrix.python-version }}
runs-on: macos-11
strategy:
matrix:
Expand Down Expand Up @@ -144,8 +138,7 @@ jobs:
cd .. && python3 -m pytest -rs pillow_heif
manylinux-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: 🐍 • Ubuntu-Focal • ${{ matrix.python-version }}
name: Ubuntu-Focal • ${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
Expand Down

0 comments on commit aa29629

Please sign in to comment.