Skip to content

Commit

Permalink
feat/automations (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 6, 2024
1 parent fcae460 commit caae896
Show file tree
Hide file tree
Showing 13 changed files with 600 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/conventional-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# auto add labels to PRs
on:
pull_request_target:
types: [ opened, edited ]
name: conventional-release-labels
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/conventional-release-labels@v1
125 changes: 125 additions & 0 deletions .github/workflows/publish_alpha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# 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 Event
run: |
echo "GitHub Event Payload:"
echo "${{ toJson(github.event) }}"
echo "Labels in Pull Request:"
echo "${{ toJson(github.event.pull_request.labels) }}"
- name: Determine version bump
id: version_bump
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
LABELS=$(jq -r '.pull_request.labels[].name' <<< "${{ toJson(github.event) }}")
echo "Labels: $LABELS"
else
echo "Not a pull request, defaulting to alpha."
echo "::set-output name=part::alpha"
fi
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: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: V${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
body: |
Changes in this Release
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: true
commitish: dev

- name: Build Distribution Packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{secrets.PYPI_TOKEN}}
73 changes: 73 additions & 0 deletions .github/workflows/publish_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow will generate a STABLE distribution and upload it to PyPI

name: Publish Stable Release
on:
push:
branches:
- master
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 # otherwise, there would be 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: Remove Alpha tag
run: |
python scripts/remove_alpha.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: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: V${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
body: |
Changes in this Release
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: true
commitish: dev
- name: Build Distribution Packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{secrets.PYPI_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
commitish: dev
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
python setup.py sdist bdist_wheel
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Changelog

## [Unreleased](https://github.com/OpenJarbas/tutubo/tree/HEAD)

[Full Changelog](https://github.com/OpenJarbas/tutubo/compare/V0.0.2a4...HEAD)

**Merged pull requests:**

- fix automations [\#9](https://github.com/OpenJarbas/tutubo/pull/9) ([JarbasAl](https://github.com/JarbasAl))

## [V0.0.2a4](https://github.com/OpenJarbas/tutubo/tree/V0.0.2a4) (2024-09-06)

[Full Changelog](https://github.com/OpenJarbas/tutubo/compare/V0.0.2a3...V0.0.2a4)

**Merged pull requests:**

- feat:url [\#8](https://github.com/OpenJarbas/tutubo/pull/8) ([JarbasAl](https://github.com/JarbasAl))

## [V0.0.2a3](https://github.com/OpenJarbas/tutubo/tree/V0.0.2a3) (2024-09-06)

[Full Changelog](https://github.com/OpenJarbas/tutubo/compare/V0.0.2...V0.0.2a3)

**Implemented enhancements:**

- feat/automations [\#4](https://github.com/OpenJarbas/tutubo/pull/4) ([JarbasAl](https://github.com/JarbasAl))

**Fixed bugs:**

- fix/videos [\#3](https://github.com/OpenJarbas/tutubo/pull/3) ([JarbasAl](https://github.com/JarbasAl))
- fix/channel\_playlist\_parsing [\#2](https://github.com/OpenJarbas/tutubo/pull/2) ([JarbasAl](https://github.com/JarbasAl))

**Merged pull requests:**

- fix:version\_file\_path [\#7](https://github.com/OpenJarbas/tutubo/pull/7) ([JarbasAl](https://github.com/JarbasAl))
- fix:missing\_import [\#6](https://github.com/OpenJarbas/tutubo/pull/6) ([JarbasAl](https://github.com/JarbasAl))

## [V0.0.2](https://github.com/OpenJarbas/tutubo/tree/V0.0.2) (2024-06-22)

[Full Changelog](https://github.com/OpenJarbas/tutubo/compare/V0.0.2a1...V0.0.2)

**Fixed bugs:**

- Zero-indexing where a list may be empty [\#1](https://github.com/OpenJarbas/tutubo/issues/1)

## [V0.0.2a1](https://github.com/OpenJarbas/tutubo/tree/V0.0.2a1) (2024-05-24)

[Full Changelog](https://github.com/OpenJarbas/tutubo/compare/cc472cda4ac3f28838dbb3f4d7197569dc8ddf2a...V0.0.2a1)



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
File renamed without changes.
Loading

0 comments on commit caae896

Please sign in to comment.