From 5ed27a431668a8c6394e0f86faf262675b873f53 Mon Sep 17 00:00:00 2001 From: Jan Richter Date: Tue, 26 Mar 2024 14:30:52 +0100 Subject: [PATCH] Build eggs for python 3.12 in release workflow fix From the python 3.12 the setuptools are not part of python and needs to be installed separately. Let's update the release workflow to handle this issue until #5754 will be fixed. Signed-off-by: Jan Richter --- .github/workflows/release.yml | 169 +++++++++++++++++----------------- 1 file changed, 86 insertions(+), 83 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 471efeba81..42cd3867ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,93 +26,96 @@ on: jobs: - release: - name: Release pipeline - runs-on: ubuntu-latest - container: - image: fedora:34 - env: - VERSION: ${{ github.event.inputs.version }} - DEVEL_NAME: ${{ github.event.inputs.devel_name }} - DEVEL_MAIL: ${{ github.event.inputs.devel_mail }} - PYTHON: /usr/bin/python3 - #TOKEN_RTD: ${{ secrets.RTD_TOKEN }} - #URL: "https://readthedocs.org/api/v3/projects/${{ github.event.inputs.rtd_project }}" + # release: + # name: Release pipeline + # runs-on: ubuntu-latest + # container: + # image: fedora:34 + # env: + # VERSION: ${{ github.event.inputs.version }} + # DEVEL_NAME: ${{ github.event.inputs.devel_name }} + # DEVEL_MAIL: ${{ github.event.inputs.devel_mail }} + # PYTHON: /usr/bin/python3 + # TOKEN_RTD: ${{ secrets.RTD_TOKEN }} + # URL: "https://readthedocs.org/api/v3/projects/${{ github.event.inputs.rtd_project }}" + # + # steps: + # - name: Generate token + # id: generate_token + # uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c + # with: + # app_id: ${{ secrets.MR_AVOCADO_ID }} + # installation_id: ${{ secrets.MR_AVOCADO_INSTALLATION_ID }} + # private_key: ${{ secrets.MR_AVOCADO_PRIVATE_KEY }} + # - name: install required packages + # run: dnf -y install rpmdevtools git python3-pip make + # - uses: actions/checkout@v3 + # with: + # persist-credentials: false + # fetch-depth: 0 + # - name: Update VERSION files and python-avocado.spec + # run: | + # make -f Makefile.gh propagate-version + # make -f Makefile.gh release-update-spec + # - name: Commit files and tag + # run: | + # git config --global --add safe.directory `pwd` + # git config --local user.email "${{ github.event.inputs.devel_mail }}" + # git config --local user.name "${{ github.event.inputs.devel_name }}" + # make -f Makefile.gh release-commit-tag + # - name: Push changes to github + # uses: ad-m/github-push-action@master + # with: + # github_token: ${{ steps.generate_token.outputs.token }} + # branch: ${{ github.ref }} + # - name: Build wheel + # run: make -f Makefile.gh build-wheel check-wheel + # - name: Save wheel as artifact + # uses: actions/upload-artifact@v3 + # with: + # name: wheel + # path: ${{github.workspace}}/PYPI_UPLOAD/ + # retention-days: 3 + # - name: Build documentation readthedocs + # run: | + # make -f Makefile.gh build-update-readthedocs + # - run: echo "In a few minutes the release documentation will be available in https://${{ github.event.inputs.rtd_project }}.readthedocs.io/en/${{ github.event.inputs.version }}/" + # - name: Upload to pypi + # continue-on-error: true + # env: + # TWINE_USERNAME: ${{ secrets.PYPI_USER }} + # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWD }} + # run: make -f Makefile.gh update-pypi + + build-and-publish-eggs: + name: Build eggs and publish them + runs-on: ubuntu-20.04 + needs: release + strategy: + matrix: + python-version: [3.12.0] + fail-fast: false steps: - - name: Generate token - id: generate_token - uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c - with: - app_id: ${{ secrets.MR_AVOCADO_ID }} - installation_id: ${{ secrets.MR_AVOCADO_INSTALLATION_ID }} - private_key: ${{ secrets.MR_AVOCADO_PRIVATE_KEY }} - - name: install required packages - run: dnf -y install rpmdevtools git python3-pip make - uses: actions/checkout@v3 with: persist-credentials: false fetch-depth: 0 - - name: Update VERSION files and python-avocado.spec - run: | - make -f Makefile.gh propagate-version - make -f Makefile.gh release-update-spec - - name: Commit files and tag - run: | - git config --global --add safe.directory `pwd` - git config --local user.email "${{ github.event.inputs.devel_mail }}" - git config --local user.name "${{ github.event.inputs.devel_name }}" - make -f Makefile.gh release-commit-tag - - name: Push changes to github - uses: ad-m/github-push-action@master + ref: ${{ github.event.inputs.version }} + - name: Set up Python + uses: actions/setup-python@v4 with: - github_token: ${{ steps.generate_token.outputs.token }} - branch: ${{ github.ref }} - # - name: Build wheel - # run: make -f Makefile.gh build-wheel check-wheel - # - name: Save wheel as artifact - # uses: actions/upload-artifact@v3 - # with: - # name: wheel - # path: ${{github.workspace}}/PYPI_UPLOAD/ - # retention-days: 3 - # - name: Build documentation readthedocs - # run: | - # make -f Makefile.gh build-update-readthedocs - # - run: echo "In a few minutes the release documentation will be available in https://${{ github.event.inputs.rtd_project }}.readthedocs.io/en/${{ github.event.inputs.version }}/" - # - name: Upload to pypi - # continue-on-error: true - # env: - # TWINE_USERNAME: ${{ secrets.PYPI_USER }} - # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWD }} - # run: make -f Makefile.gh update-pypi - # - # build-and-publish-eggs: - # name: Build eggs and publish them - # runs-on: ubuntu-20.04 - # needs: release - # strategy: - # matrix: - # python-version: [3.8.16, 3.9.16, 3.10.9, 3.11.1, 3.12.0] - # fail-fast: false - # - # steps: - # - uses: actions/checkout@v3 - # with: - # persist-credentials: false - # fetch-depth: 0 - # ref: ${{ github.event.inputs.version }} - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Build eggs - # run: make -f Makefile.gh build-egg - # - name: Upload binaries to release - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.RELEASE_TOKEN }} - # file: ${{ github.workspace }}/EGG_UPLOAD/avocado_framework*egg - # tag: ${{ github.event.inputs.version }} - # overwrite: true - # file_glob: true + python-version: ${{ matrix.python-version }} + - name: Install setuptools + if: ${{ matrix.python-version }} >= 3.12.0 + run: pip install setuptools + - name: Build eggs + run: make -f Makefile.gh build-egg + # - name: Upload binaries to release + # uses: svenstaro/upload-release-action@v2 + # with: + # repo_token: ${{ steps.generate_token.outputs.token }} + # file: ${{ github.workspace }}/EGG_UPLOAD/avocado_framework*egg + # tag: ${{ github.event.inputs.version }} + # overwrite: true + # file_glob: true