Release #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
package: | |
description: 'Package to be deployed' | |
required: true | |
default: 'paddlenlp' | |
type: choice | |
options: | |
- paddlenlp | |
- paddle-pipelines | |
- ppdiffusers | |
jobs: | |
Release: | |
name: Release | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Should Deploy | |
id: should-deploy | |
env: | |
PACKAGE: ${{ inputs.package }} | |
run: python scripts/should_deploy.py --name $PACKAGE >> $GITHUB_OUTPUT | |
- name: Check Branch | |
id: check-branch | |
run: | | |
if [[ ${{ github.ref }} =~ ^refs/heads/(develop)$ ]]; then | |
echo "match=true" >> $GITHUB_OUTPUT | |
fi # See: https://stackoverflow.com/a/58869470/1123955 | |
- name: Is A Publish Branch | |
if: steps.check-branch.outputs.match == 'true' && steps.should-deploy.outputs.should_deploy == 'true' | |
env: | |
TWINE_USERNAME: paddle-dev | |
TWINE_PASSWORD: ${{ secrets.paddlenlp }} | |
PACKAGE: ${{ inputs.package }} | |
PADDLENLP_STABLE_VERSION: "true" | |
run: | | |
make deploy-$PACKAGE | |
- name: Should Not Deploy To Pypi Server | |
if: steps.should-deploy.outputs.should_deploy != 'true' | |
run: echo 'should not deploy pypi server' | |
- name: Is Not A Publish Branch | |
if: steps.check-branch.outputs.match != 'true' | |
run: echo 'Not A Publish Branch' |