From 2eb04b88398169464fb401eae1cf914889019ac9 Mon Sep 17 00:00:00 2001 From: NeonKirill Date: Sun, 30 Jun 2024 15:15:00 +0200 Subject: [PATCH] small fix to permissions and setup --- .../workflows/bump_dynamic_dependencies.yml | 43 +++++++++++++++++++ .github/workflows/deploy_containers.yml | 8 ++-- .github/workflows/publish_version_change.yml | 31 ------------- 3 files changed, 46 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/bump_dynamic_dependencies.yml delete mode 100644 .github/workflows/publish_version_change.yml diff --git a/.github/workflows/bump_dynamic_dependencies.yml b/.github/workflows/bump_dynamic_dependencies.yml new file mode 100644 index 00000000..35ef50ac --- /dev/null +++ b/.github/workflows/bump_dynamic_dependencies.yml @@ -0,0 +1,43 @@ +# This workflow will generate a distribution and upload it to PyPI + +name: Bump Dynamic Dependencies +on: + workflow_call: + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install Setuptools + run: | + python -m pip install -U pip setuptools + - name: Install Build Tools + run: | + python -m pip install build wheel + - name: Increment Version + run: | + VER=$(python setup.py --version) + python version_bump.py -b ${{ github.ref_name }} + - name: Install JS Beautifier + if: github.ref == 'refs/heads/alpha' + run: | + python -m pip install jsbeautifier==1.15.1 + - name: Build Nano JS + if: github.ref == 'refs/heads/alpha' + working-directory: ./ + run: python ./scripts/file_merger.py --working_dir ./chat_client/static --weighted_dirs 1=['js'] --weighted_files 0=['nano_builder.js'] --skip_files meta.js klatchatNano.js --save_to ./js/klatchatNano.js --beautify 1 + - name: Build Nano CSS + if: github.ref == 'refs/heads/alpha' + working-directory: ./ + run: python ./scripts/file_merger.py --working_dir ./chat_client/static --weighted_dirs 1=['css'] --skip_files sidebar.css klatchatNano.css --save_to ./css/klatchatNano.css --beautify 0 + - name: Push Version Change + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Updated Version and Dynamic Dependencies diff --git a/.github/workflows/deploy_containers.yml b/.github/workflows/deploy_containers.yml index e49d70fb..34eb0fdc 100644 --- a/.github/workflows/deploy_containers.yml +++ b/.github/workflows/deploy_containers.yml @@ -24,13 +24,11 @@ jobs: secrets: PYKLATCHAT_TESTING_CREDENTIALS_V2: ${{ secrets.PYKLATCHAT_TESTING_CREDENTIALS_V2 }} SERVER_ENV: ${{ secrets.SERVER_ENV }} - build-nano: - uses: ./.github/workflows/build_nano_assets.yml - bump-version: - uses: ./.github/workflows/publish_version_change.yml + bump-dynamic-dependencies: + uses: ./.github/workflows/bump_dynamic_dependencies.yml publish-images: runs-on: ubuntu-latest - needs: [run-tests, bump-version, build-nano] + needs: [run-tests, bump-dynamic-dependencies, build-nano] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/publish_version_change.yml b/.github/workflows/publish_version_change.yml deleted file mode 100644 index 5f9a9f55..00000000 --- a/.github/workflows/publish_version_change.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Version Change -on: - workflow_call: - -jobs: - build_and_publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref_name }} - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - name: Install Setuptools - run: | - python -m pip install -U pip setuptools - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: Increment Version - run: | - VER=$(python setup.py --version) - python version_bump.py -b ${{ github.ref_name }} - - name: Push Version Change - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Incremented Version