[44] fixed default's versions

This commit is contained in:
meisnate12 2022-09-22 14:34:25 -04:00
parent c26e8a6b34
commit 2170081be4
4 changed files with 46 additions and 20 deletions

View file

@ -17,10 +17,6 @@ jobs:
with:
fetch-depth: 0
- name: Get Previous tag
id: previoustag
run: echo "::set-output name=OLDVERSION::$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
@ -100,8 +96,8 @@ jobs:
- name: Create & Push Tag
working-directory: ./pmmconfigs
run: |
git tag ${{ steps.previoustag.outputs.OLDVERSION }}
git push origin ${{ steps.previoustag.outputs.OLDVERSION }}
git tag ${{ steps.get_version.outputs.VERSION }}
git push origin ${{ steps.get_version.outputs.VERSION }}
- name: Create release
id: create_release
@ -109,5 +105,5 @@ jobs:
with:
body: ${{ steps.notes.outputs.notes }}
token: ${{ secrets.PAT }}
tag_name: ${{ steps.previoustag.outputs.OLDVERSION }}
tag_name: ${{ steps.get_version.outputs.VERSION }}
repository: meisnate12/Plex-Meta-Manager-Configs

View file

@ -1 +1 @@
1.17.3-develop43
1.17.3-develop44

View file

@ -10,6 +10,7 @@ class GitHub:
def __init__(self, config):
self.config = config
self._configs_url = None
self._config_tags = []
def latest_release_notes(self):
response = self.config.get_json(f"{base_url}/releases/latest")
@ -29,15 +30,23 @@ class GitHub:
commits.append(message)
return "\n".join(commits)
@property
def config_tags(self):
if not self._config_tags:
try:
self._config_tags = [r["ref"][10:] for r in self.config.get_json(f"{base_url}-Configs/git/refs/tags")]
except TypeError:
pass
return self._config_tags
@property
def configs_url(self):
if self._configs_url is None:
try:
config_tags = [r["ref"][10:] for r in self.config.get_json(f"{base_url}-Configs/git/refs/tags")]
except TypeError:
config_tags = []
if self.config.version[1] in config_tags:
self._configs_url = f"{configs_raw_url}/{self.config.version[1]}/"
else:
self._configs_url = f"{configs_raw_url}/master/"
self._configs_url = f"{configs_raw_url}/master/"
if self.config.latest_version[1] != self.config.version[1]:
if self.config.version[1] in self.config_tags:
self._configs_url = f"{configs_raw_url}/{self.config.version[1]}/"
elif not self.config.check_nightly and self.config.version[2] > 0:
if util.get_develop()[2] >= self.config.version[2]:
self._configs_url = f"{configs_raw_url}/{self.config.version[1]}/"
return self._configs_url

View file

@ -98,14 +98,35 @@ start_time = None
def current_version(version, nightly=False):
if nightly:
return get_version("nightly")
return get_nightly()
elif version[2] > 0:
new_version = get_version("develop")
new_version = get_develop()
if version[1] != new_version[1] or new_version[2] >= version[2]:
return new_version
return get_version("nightly")
return get_nightly()
else:
return get_version("master")
return get_master()
nightly_version = None
def get_nightly():
global nightly_version
if nightly_version is None:
nightly_version = get_version("nightly")
return nightly_version
develop_version = None
def get_develop():
global develop_version
if develop_version is None:
develop_version = get_version("develop")
return develop_version
master_version = None
def get_master():
global master_version
if master_version is None:
master_version = get_version("master")
return master_version
def get_version(level):
try: