Skip to content

feat:test

feat:test #8

Workflow file for this run

# This workflow will generate an ALPHA release distribution and upload it to PyPI
name: Publish Alpha Build
on:
pull_request:
types: [closed]
branches:
- dev
paths-ignore:
- 'version.py'
- 'test/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'README.md'
- 'scripts/**'
workflow_dispatch:
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: dev
fetch-depth: 0 # to avoid errors pushing refs to the destination repository
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Debug GitHub Labels
run: |
echo "Labels in Pull Request:"
echo "${{ toJson(github.event.pull_request.labels) }}"
- name: Determine version bump
id: version_bump
run: |
LABELS=$(jq -r '.[].name' <<< "${{ toJson(github.event.pull_request.labels) }}")
echo "Labels: $LABELS"
MAJOR=0
MINOR=0
BUILD=0
for label in $LABELS; do
if [ "$label" == "breaking" ]; then
MAJOR=1
elif [ "$label" == "feature" ]; then
MINOR=1
elif [ "$label" == "fix" ]; then
BUILD=1
fi
done
if [ $MAJOR -eq 1 ]; then
echo "::set-output name=part::major"
elif [ $MINOR -eq 1 ]; then
echo "::set-output name=part::minor"
elif [ $BUILD -eq 1 ]; then
echo "::set-output name=part::build"
else
echo "::set-output name=part::alpha"
fi
- name: Update version in version.py
run: |
python scripts/update_version.py ${{ steps.version_bump.outputs.part }} --version-file $GITHUB_WORKSPACE/tutubo/version.py
- name: "Generate release changelog"
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
maxIssues: 50
id: changelog
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Increment Version
branch: dev
- name: version
run: echo "::set-output name=version::$(python setup.py --version)"
id: version
- name: Build Distribution Packages
run: |
python setup.py sdist bdist_wheel