Skip to content

Commit

Permalink
Setup GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Sep 20, 2021
1 parent d582705 commit be6cd6b
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: release

on:
create:
tags:
- v*

jobs:
tagged-release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Create Release for new Tag
uses: marvinpinto/action-automatic-releases@latest
with:
title: ArrAPI ${{ github.event.ref }}
repo_token: ${{ secrets.PAT }}
prerelease: false
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tag

on:
push:
branches: [ master ]

jobs:
tag-new-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
fetch-depth: 2
- uses: salsify/action-detect-and-tag-new-version@v2
with:
token: ${{ secrets.PAT }}
version-command: |
cat VERSION
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.3
15 changes: 14 additions & 1 deletion arrapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import os, pkg_resources

from .exceptions import ArrException, ConnectionFailure, Exists, Invalid, NotFound, Unauthorized
from .objs import QualityProfile, LanguageProfile, MetadataProfile, RemotePathMapping, RootFolder, UnmappedFolder, SystemStatus, Tag, Movie, Series, Season
from .sonarr import SonarrAPI
from .radarr import RadarrAPI
from .lidarr import LidarrAPI
from .readarr import ReadarrAPI

__version__ = "1.1.3"
try:
__version__ = pkg_resources.get_distribution("arrapi").version
except pkg_resources.DistributionNotFound:
if os.path.exists("../VERSION"):
with open("../VERSION") as handle:
for line in handle.readlines():
line = line.strip()
if len(line) > 0:
__version__ = line
break
else:
__version__ = ""
__author__ = "Nathan Taggart"
__credits__ = "meisnate12"
__package_name__ = "arrapi"
Expand Down
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-

import os, re, sys
import os, sys
from shutil import rmtree

from setuptools import setup, Command

with open("arrapi/__init__.py") as handle:
with open("VERSION") as handle:
for line in handle.readlines():
if line.startswith("__version__"):
version = re.findall('"([0-9\.]+?)"', line)[0]
line = line.strip()
if len(line) > 0:
version = line
break

with open("README.rst", "r") as f:
Expand Down Expand Up @@ -63,6 +64,12 @@ def run(self):
install_requires=[
"requests"
],
project_urls={
"Documentation": "https://arrapi.readthedocs.io/en/latest/",
"Funding": "https://github.com/sponsors/meisnate12",
"Source": "https://github.com/meisnate12/ArrAPI",
"Issues": "https://github.com/meisnate12/ArrAPI/issues",
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down

0 comments on commit be6cd6b

Please sign in to comment.