Skip to content

Commit

Permalink
Merge pull request #19 from martynvdijke/develop
Browse files Browse the repository at this point in the history
Release 0.,4.2
  • Loading branch information
martynvdijke authored Jul 3, 2024
2 parents ecb5b77 + 6c1f840 commit c095cc5
Show file tree
Hide file tree
Showing 13 changed files with 354 additions and 1,891 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CD

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for changelog and tag

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # Adjust to your project's Python version

- name: Install Poetry
run: pip install poetry

- name: Configure Poetry to use the same Python version as setup-python
run: poetry env use $(python -c "import sys; print(sys.executable)")

- name: Install dependencies
run: poetry install

- name: Install Git Chglog
run: |
curl -sSL https://git.io/install-git-chglog | bash -s -- -b /usr/local/bin
git-chglog --version
- name: Generate Changelog
run: git-chglog -o CHANGELOG.md

- name: Commit Changelog
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add CHANGELOG.md
git commit -m "chore: update changelog"
- name: Bump version and tag
id: tag
run: |
VERSION=$(poetry version -s)
NEW_TAG=v$(echo $VERSION | awk -F. '{$NF += 1; OFS="."; print}')
echo "Bumping tag to $NEW_TAG"
git tag $NEW_TAG
git push origin $NEW_TAG
git push origin master
echo "::set-output name=new_tag::$NEW_TAG"
- name: Push changes
run: git push origin master

- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build --username __token__ --password $POETRY_PYPI_TOKEN

- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.new_tag }}
release_name: Release ${{ steps.tag.outputs.new_tag }}
draft: false
prerelease: false
body: |
See the changelog for details.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry

- name: Configure Poetry to use the same Python version as setup-python
run: poetry env use $(python -c "import sys; print(sys.executable)")

- name: Install dependencies
run: poetry install

- name: Run ruff
run: poetry run ruff .

- name: Run tests
run: poetry run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ lib64
*.pyc
*.pyo
youtube_playlist_randomizer/__pycache_/*
poetry.lock
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

## v0.1.1

Fixed cli input as an package to actually work

## v0.1
First release

First release
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,46 @@
<!-- [![Build Status][build-image]][build-url] -->

## Summary

Since the Chromecast can not shuffle an youtube list, and I sometimes want to just lay back and watch my favourite playlist in random order i came up with this pacakge.
This is a simple python package that takes a youtube playlist as input randomizes it and saves the youtube playlist.

## Installation

```sh
pip install youtube-playlist-randomizer
```

### CLI Documentation

```python
Playlist randomizer

options:
-h, --help show this help message and exit
--version show programs version number and exit
-n specify the amount of inserts to execute
--version show program's version number and exit
-v, --verbose set loglevel to INFO
-vv, --very-verbose set loglevel to DEBUG
-n CHUNKS, --number_of CHUNKS
Specify the number of update request to do per 24 hours [default=190]
-i INPUT, --input INPUT
specify the secret client json file default='client_secret.json'
Specify the secret client json file [default='client_secret.json']
```

### Config
This scripts needs a client_secret.json file you can get one by going to

This scripts needs a client_secret.json file you can get one by going to
[google docs](https://developers.google.com/youtube/v3/quickstart/python)
and follow step 1 of that tutorial and save the client_secret.json to disk.

## Usage

After installing and getting the client secret file just run and follow the instructions in the folder you saved the json file.

```sh
youtube-playlist-randomizer -i client_secret.json
```


## [Changelog](CHANGELOG.md)

## License
Expand All @@ -45,6 +55,4 @@ youtube-playlist-randomizer -i client_secret.json
<!-- Badges -->

[pypi-image]: https://img.shields.io/pypi/v/youtube-playlist-randomizer
[pypi-url]: https://pypi.org/project/youtube-playlist-randomizer
[build-image]: https://github.com/martynvdijke/gr-lora_sdr-profiler/actions/workflows/build.yml/badge.svg
[build-url]: https://github.com/martynvdijke/gr-lora_sdr-profiler/actions/workflows/build.yml
[pypi-url]: https://pypi.org/project/youtube-playlist-randomizer
Loading

0 comments on commit c095cc5

Please sign in to comment.