From 1df7f8c62c3980354076e45cedb69aeff55332d5 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 28 Feb 2024 18:57:06 -0500 Subject: [PATCH] Fix more workflow files. No-Issue Signed-off-by: James Tanner --- .github/workflows/build_publish.yml | 126 +++++++++++++-------------- .github/workflows/nightly_latest.yml | 12 +-- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index 938534c0fa..ae4dc7a08c 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -15,66 +15,66 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - - - name: Get galaxy_ng package version - shell: bash - run: echo "galaxy_ng_version=$(python3 setup.py --version)" >> $GITHUB_ENV - - - name: Validate tag and galaxy_ng version match - shell: bash - if: env.galaxy_ng_version != github.ref_name - run: | - echo "::error::Tag ${{ github.ref_name }} and galaxy_ng version ${{ env.galaxy_ng_version }} doesn't match." - exit 1 - - - name: Update apt - run: sudo apt -y update - - - name: Install LDAP requirements - run: sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev build-essential gettext python-setuptools - - - name: Upgrade pip - run: pip install pip --upgrade - - - name: Install galaxy_ng editable - run: pip install -e . - - # set variable for the next step, so only versions higher than 4.4 gets translated - # 4.2 and 4.3 don't support translations - - name: Check galaxy_ng version for translations - shell: bash - id: version_check - run: | - is_translatable=$(python -c 'from pkg_resources import parse_version; cmp_res = parse_version("${{ env.galaxy_ng_version }}") >= parse_version("4.4"); print(cmp_res)') - echo "is_translatable=$is_translatable" >> $GITHUB_OUTPUT - - - name: Build API translations - shell: bash - run: "django-admin compilemessages" - if: steps.version_check.outputs.is_translatable == 'True' - - - name: Check if UI has corresponding tag - shell: bash - run: | - status_code=$(curl -LI https://api.github.com/repos/ansible/ansible-hub-ui/releases/tags/${{ env.galaxy_ng_version }} -o /dev/null -w '%{http_code}\n' -s) - if [ $status_code == "404" ] - then - echo "::error::Corresponding tag ${{ env.galaxy_ng_version }} for ansible-hub-ui not found." - exit 1 - fi - - - name: Build galaxy_ng python packages - run: "python3 setup.py sdist bdist_wheel" - - - name: Install twine - run: "pip install twine" - - - name: Publish galaxy_ng to PyPI - run: "python3 -m twine upload dist/*" - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_RELEASE_TOKEN }} + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Get galaxy_ng package version + shell: bash + run: echo "galaxy_ng_version=$(python3 setup.py --version)" >> $GITHUB_ENV + + - name: Validate tag and galaxy_ng version match + shell: bash + if: env.galaxy_ng_version != github.ref_name + run: | + echo "::error::Tag ${{ github.ref_name }} and galaxy_ng version ${{ env.galaxy_ng_version }} doesn't match." + exit 1 + + - name: Update apt + run: sudo apt -y update + + - name: Install LDAP requirements + run: sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev build-essential gettext python-setuptools + + - name: Upgrade pip + run: pip install pip --upgrade + + - name: Install galaxy_ng editable + run: pip install -e . + + # set variable for the next step, so only versions higher than 4.4 gets translated + # 4.2 and 4.3 don't support translations + - name: Check galaxy_ng version for translations + shell: bash + id: version_check + run: | + is_translatable=$(python -c 'from pkg_resources import parse_version; cmp_res = parse_version("${{ env.galaxy_ng_version }}") >= parse_version("4.4"); print(cmp_res)') + echo "is_translatable=$is_translatable" >> $GITHUB_OUTPUT + + - name: Build API translations + shell: bash + run: "django-admin compilemessages" + if: steps.version_check.outputs.is_translatable == 'True' + + - name: Check if UI has corresponding tag + shell: bash + run: | + status_code=$(curl -LI https://api.github.com/repos/ansible/ansible-hub-ui/releases/tags/${{ env.galaxy_ng_version }} -o /dev/null -w '%{http_code}\n' -s) + if [ $status_code == "404" ] + then + echo "::error::Corresponding tag ${{ env.galaxy_ng_version }} for ansible-hub-ui not found." + exit 1 + fi + + - name: Build galaxy_ng python packages + run: "python3 setup.py sdist bdist_wheel" + + - name: Install twine + run: "pip install twine" + + - name: Publish galaxy_ng to PyPI + run: "python3 -m twine upload dist/*" + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_RELEASE_TOKEN }} diff --git a/.github/workflows/nightly_latest.yml b/.github/workflows/nightly_latest.yml index 297cae02e9..bd7b2cb890 100644 --- a/.github/workflows/nightly_latest.yml +++ b/.github/workflows/nightly_latest.yml @@ -46,7 +46,7 @@ jobs: echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/.ci/assets/httpie/" >> $GITHUB_ENV - name: Before Install - + run: .github/workflows/scripts/before_install.sh shell: bash env: @@ -65,7 +65,7 @@ jobs: ruby-version: "2.6" - name: Install - + run: .github/workflows/scripts/install.sh shell: bash env: @@ -79,7 +79,7 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - name: Before Script - + run: .github/workflows/scripts/before_script.sh shell: bash env: @@ -93,13 +93,13 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - name: Setting secrets - + run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" env: SECRETS_CONTEXT: ${{ toJson(secrets) }} - name: Install Python client - + run: .github/workflows/scripts/install_python_client.sh shell: bash @@ -152,4 +152,4 @@ jobs: run: | echo "${{ needs.test.outputs.deprecations-pulp }}" | base64 -d echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d - echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d \ No newline at end of file + echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d