Build Installer main by @CRThaze #2
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: "Build and Publish Installer" | |
run-name: "Build Installer ${{ github.ref_name }} by @${{ github.actor }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
required: true | |
description: Version | |
default: "" | |
is_release: | |
type: boolean | |
required: false | |
default: false | |
workflow_call: | |
inputs: | |
version: | |
type: string | |
required: true | |
description: Version | |
default: "" | |
is_release: | |
type: boolean | |
required: false | |
default: false | |
push: | |
branches: | |
- 'main' | |
paths: | |
- "deployment/installer/**" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
id: setup | |
run: | | |
if [[ "${{inputs.version}}" == "" ]]; then | |
echo "build_from=${{github.ref_name}}" | tee -a $GITHUB_OUTPUT | |
else | |
echo "build_from=${{inputs.version}}" | tee -a $GITHUB_OUTPUT | |
fi | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
ref: ${{steps.setup.outputs.build_from}} | |
fetch-tags: true | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: Build pip package | |
run: | | |
cd deployment/installer | |
pip3 install -r pub-requirements.txt | |
if [[ "${{inputs.version}}" != "" ]]; then export VERSION=${{inputs.version}};fi | |
python -m build --wheel --outdir dist/ . | |
- name: Publish package distributions to PyPI | |
if: inputs.is_release | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: deployment/installer/dist | |