Skip to content

migration to "actions/upload-artifact@v4" #308

migration to "actions/upload-artifact@v4"

migration to "actions/upload-artifact@v4" #308

Workflow file for this run

name: Publish
on:
push:
branches: [ master ]
pull_request: # temporary for test
jobs:
pillow_heif_build:
name: Pillow-Heif
uses: ./.github/workflows/wheels-pillow_heif.yml
pi_heif_build:
needs: [pillow_heif_build]
name: Pi-Heif
uses: ./.github/workflows/wheels-pi_heif.yml
publish_pypi:
needs: [pi_heif_build]
name: Upload to PyPi
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get tag
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@v4
with:
path: wheelhouse_pillow_heif
pattern: wheels_pillow_heif-*
merge-multiple: true
- name: Pi-Heif sdist and wheels
uses: actions/download-artifact@v4
with:
path: wheelhouse_pi_heif
pattern: wheels_pi_heif-*
merge-multiple: true
- name: Publish Pillow-Heif
run: |
ls -la wheelhouse_pillow_heif
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_PILLOW_HEIF }}
- name: Publish Pi-Heif
run: |
ls -la wheelhouse_pi_heif
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_PI_HEIF }}
# - 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 }}