[44] fixed default's versions

pull/1052/head
meisnate12 2 years ago
parent c26e8a6b34
commit 2170081be4

@ -17,10 +17,6 @@ jobs:
with: with:
fetch-depth: 0 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 - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
@ -100,8 +96,8 @@ jobs:
- name: Create & Push Tag - name: Create & Push Tag
working-directory: ./pmmconfigs working-directory: ./pmmconfigs
run: | run: |
git tag ${{ steps.previoustag.outputs.OLDVERSION }} git tag ${{ steps.get_version.outputs.VERSION }}
git push origin ${{ steps.previoustag.outputs.OLDVERSION }} git push origin ${{ steps.get_version.outputs.VERSION }}
- name: Create release - name: Create release
id: create_release id: create_release
@ -109,5 +105,5 @@ jobs:
with: with:
body: ${{ steps.notes.outputs.notes }} body: ${{ steps.notes.outputs.notes }}
token: ${{ secrets.PAT }} token: ${{ secrets.PAT }}
tag_name: ${{ steps.previoustag.outputs.OLDVERSION }} tag_name: ${{ steps.get_version.outputs.VERSION }}
repository: meisnate12/Plex-Meta-Manager-Configs repository: meisnate12/Plex-Meta-Manager-Configs

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

@ -10,6 +10,7 @@ class GitHub:
def __init__(self, config): def __init__(self, config):
self.config = config self.config = config
self._configs_url = None self._configs_url = None
self._config_tags = []
def latest_release_notes(self): def latest_release_notes(self):
response = self.config.get_json(f"{base_url}/releases/latest") response = self.config.get_json(f"{base_url}/releases/latest")
@ -30,14 +31,22 @@ class GitHub:
return "\n".join(commits) return "\n".join(commits)
@property @property
def configs_url(self): def config_tags(self):
if self._configs_url is None: if not self._config_tags:
try: try:
config_tags = [r["ref"][10:] for r in self.config.get_json(f"{base_url}-Configs/git/refs/tags")] self._config_tags = [r["ref"][10:] for r in self.config.get_json(f"{base_url}-Configs/git/refs/tags")]
except TypeError: except TypeError:
config_tags = [] pass
if self.config.version[1] in config_tags: return self._config_tags
self._configs_url = f"{configs_raw_url}/{self.config.version[1]}/"
else: @property
self._configs_url = f"{configs_raw_url}/master/" def configs_url(self):
if self._configs_url is None:
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 return self._configs_url

@ -98,14 +98,35 @@ start_time = None
def current_version(version, nightly=False): def current_version(version, nightly=False):
if nightly: if nightly:
return get_version("nightly") return get_nightly()
elif version[2] > 0: 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]: if version[1] != new_version[1] or new_version[2] >= version[2]:
return new_version return new_version
return get_version("nightly") return get_nightly()
else: 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): def get_version(level):
try: try:

Loading…
Cancel
Save