Authored by: bashonly
This commit is contained in:
bashonly 2024-10-31 16:45:10 -05:00
parent 1c868cde15
commit c26864da13
No known key found for this signature in database
GPG key ID: 783F096F253D15B0
4 changed files with 16 additions and 19 deletions

View file

@ -504,7 +504,8 @@ jobs:
- windows32 - windows32
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/download-artifact@v4 - name: Download artifacts
uses: actions/download-artifact@v4
with: with:
path: artifact path: artifact
pattern: build-bin-* pattern: build-bin-*

View file

@ -36,7 +36,8 @@ jobs:
permissions: permissions:
id-token: write # mandatory for trusted publishing id-token: write # mandatory for trusted publishing
steps: steps:
- uses: actions/download-artifact@v4 - name: Download artifacts
uses: actions/download-artifact@v4
with: with:
path: dist path: dist
name: build-pypi name: build-pypi

View file

@ -49,7 +49,8 @@ jobs:
permissions: permissions:
id-token: write # mandatory for trusted publishing id-token: write # mandatory for trusted publishing
steps: steps:
- uses: actions/download-artifact@v4 - name: Download artifacts
uses: actions/download-artifact@v4
with: with:
path: dist path: dist
name: build-pypi name: build-pypi

View file

@ -18,10 +18,6 @@ on:
required: false required: false
default: true default: true
type: boolean type: boolean
manual_dispatch:
required: false
default: false
type: boolean
workflow_dispatch: workflow_dispatch:
inputs: inputs:
source: source:
@ -51,10 +47,6 @@ on:
description: Pre-release description: Pre-release
default: false default: false
type: boolean type: boolean
manual_dispatch:
description: Manual dispatch (do not toggle)
default: true
type: boolean
permissions: permissions:
contents: read contents: read
@ -275,6 +267,8 @@ jobs:
sed -i -E '0,/(name = ")[^"]+(")/s//\1${{ env.pypi_project }}\2/' pyproject.toml sed -i -E '0,/(name = ")[^"]+(")/s//\1${{ env.pypi_project }}\2/' pyproject.toml
- name: Build - name: Build
env:
event_name: ${{ github.event_name }}
run: | run: |
rm -rf dist/* rm -rf dist/*
make pypi-files make pypi-files
@ -285,20 +279,20 @@ jobs:
python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update" python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update"
make clean-cache make clean-cache
python -m build --no-isolation . python -m build --no-isolation .
- name: Make SHA2-SUMS files
if: ${{ !inputs.manual_dispatch }}
run: |
cd ./dist/ cd ./dist/
# make sure SHA sums are also printed to stdout # print SHA sums to stdout
sha256sum -- * | tee SHA2-256SUMS sha256sum -- * | tee SHA2-256SUMS
# also print as permanent annotations to the summary page # also print as permanent annotations to the summary page
while read -r shasum; do while read -r shasum; do
echo "::notice title=${shasum##* }::sha256: ${shasum% *}" echo "::notice title=${shasum##* }::sha256: ${shasum% *}"
done < SHA2-256SUMS done < SHA2-256SUMS
# if we're publishing from this workflow, we need to remove SHA2-256SUMS from ./dist/ now
if [[ "${event_name}" == "workflow_dispatch" ]]; then
rm SHA2-256SUMS
fi
- name: Upload PyPI artifacts - name: Upload artifacts
if: ${{ !inputs.manual_dispatch }} if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: build-pypi name: build-pypi
@ -307,7 +301,7 @@ jobs:
compression-level: 0 compression-level: 0
- name: Publish to PyPI - name: Publish to PyPI
if: inputs.manual_dispatch if: github.event_name == 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@release/v1 uses: pypa/gh-action-pypi-publish@release/v1
with: with:
verbose: true verbose: true