From 6bd98c3ba8ace7efd19d73c9aab9a3e06a109208 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 29 May 2024 11:37:34 -0400 Subject: [PATCH 1/2] [29] add params --- .github/workflows/validate.yml | 43 +++++----------------------------- VERSION | 2 +- modules/request.py | 4 ++-- 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index fab28bd2..c671e054 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -27,49 +27,18 @@ jobs: - name: Run Spellcheck uses: rojopolis/spellcheck-github-actions@0.36.0 - verify-changes: + docker-build: runs-on: ubuntu-latest needs: [ validate-pull ] if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.base_ref == 'nightly' && startswith(github.head_ref, 'docker-') - outputs: - build: ${{ steps.list-changes.outputs.build }} - tag: ${{ steps.create-tag.outputs.docker-tag }} steps: - + - name: Create Tag id: create-tag run: | var="${{ github.head_ref }}" echo "docker-tag=${var:7}" >> $GITHUB_OUTPUT - - name: Check Out Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.head_ref }} - - - name: Get changes - id: get-changes - run: echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT - - - name: List changed files - id: list-changes - run: | - for file in ${{ steps.get-changes.outputs.files }}; do - if [[ $file =~ ^(defaults|fonts|modules|kometa.py|requirements.txt|.dockerignore|Dockerfile).*$ ]] ; then - echo "$file will trigger docker build" - echo "build=true" >> $GITHUB_OUTPUT - else - echo "$file will not trigger docker build" - fi - done - - docker-build: - runs-on: ubuntu-latest - needs: [ verify-changes ] - if: needs.verify-changes.outputs.build == 'true' - steps: - - name: Check Out Repo uses: actions/checkout@v4 with: @@ -97,10 +66,10 @@ jobs: context: ./ file: ./Dockerfile build-args: | - "BRANCH_NAME=${{ needs.verify-changes.outputs.tag }}" + "BRANCH_NAME=${{ steps.create-tag.outputs.docker-tag }}" platforms: linux/amd64,linux/arm64 push: true - tags: kometateam/kometa:${{ needs.verify-changes.outputs.tag }} + tags: kometateam/kometa:${{ steps.create-tag.outputs.docker-tag }} cache-from: type=gha cache-to: type=gha,mode=max @@ -109,7 +78,7 @@ jobs: if: success() with: webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} - title: "${{ vars.REPO_NAME }} ${{ needs.verify-changes.outputs.tag }}: ${{ vars.TEXT_SUCCESS }}" + title: "${{ vars.REPO_NAME }} ${{ steps.create-tag.outputs.docker-tag }}: ${{ vars.TEXT_SUCCESS }}" url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} color: ${{ vars.COLOR_SUCCESS }} username: ${{ vars.BOT_NAME }} @@ -123,7 +92,7 @@ jobs: with: webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} message: ${{ vars.BUILD_FAILURE_ROLE }} - title: "${{ vars.REPO_NAME }} ${{ needs.verify-changes.outputs.tag }}: ${{ vars.TEXT_FAILURE }}" + title: "${{ vars.REPO_NAME }} ${{ steps.create-tag.outputs.docker-tag }}: ${{ vars.TEXT_FAILURE }}" url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} color: ${{ vars.COLOR_FAILURE }} username: ${{ vars.BOT_NAME }} diff --git a/VERSION b/VERSION index f875567a..8ef5e256 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.1-develop28 +2.0.1-develop29 diff --git a/modules/request.py b/modules/request.py index 22f7c65c..3559552d 100644 --- a/modules/request.py +++ b/modules/request.py @@ -96,8 +96,8 @@ class Requests: def file_yaml(self, path_to_file, check_empty=False, create=False, start_empty=False): return YAML(path=path_to_file, check_empty=check_empty, create=create, start_empty=start_empty) - def get_yaml(self, url, headers=None, check_empty=False): - response = self.get(url, headers=headers) + def get_yaml(self, url, headers=None, params=None, check_empty=False): + response = self.get(url, headers=headers, params=params) if response.status_code >= 400: raise Failed(f"URL Error: No file found at {url}") return YAML(input_data=response.content, check_empty=check_empty) From fb72ee1a661cf4fc7474049a061eb23573476b00 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 29 May 2024 11:54:09 -0400 Subject: [PATCH 2/2] [30] update version display --- .github/workflows/validate.yml | 2 +- VERSION | 2 +- modules/request.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c671e054..407d8cd8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,7 +32,7 @@ jobs: needs: [ validate-pull ] if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.base_ref == 'nightly' && startswith(github.head_ref, 'docker-') steps: - + - name: Create Tag id: create-tag run: | diff --git a/VERSION b/VERSION index 8ef5e256..e9105543 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.1-develop29 +2.0.1-develop30 diff --git a/modules/request.py b/modules/request.py index 3559552d..eefb8dbd 100644 --- a/modules/request.py +++ b/modules/request.py @@ -161,7 +161,7 @@ class Requests: def guess_branch(self): if self.git_branch: return self.git_branch - elif self.env_version in ["nightly", "develop"]: + elif self.env_version: return self.env_version elif self.file_version[2] > 0: dev_version = self.get_develop() @@ -173,10 +173,10 @@ class Requests: return "master" def current_version(self, version, branch=None): - if branch == "nightly": - return self.get_nightly() - elif branch == "develop": + if branch == "develop": return self.get_develop() + elif branch: + return self.get_nightly() elif version[2] > 0: new_version = self.get_develop() if version[1] != new_version[1] or new_version[2] >= version[2]: