diff --git a/.github/workflows/_changelog_entry_check.yaml b/.github/workflows/_changelog_entry_check.yaml index 8ac90673..c0783f5f 100644 --- a/.github/workflows/_changelog_entry_check.yaml +++ b/.github/workflows/_changelog_entry_check.yaml @@ -3,13 +3,14 @@ name: Changelog entry check on: workflow_call: +env: + PYTHON_VERSION: 3.12 + jobs: check_changelog_entry: name: Changelog entry check runs-on: ubuntu-latest if: (!startsWith(github.event.pull_request.title, 'docs:')) - env: - PYTHON_VERSION: 3.12 steps: - name: Checkout repository diff --git a/.github/workflows/_publish_to_pypi.yaml b/.github/workflows/_publish_to_pypi.yaml deleted file mode 100644 index 98fb9691..00000000 --- a/.github/workflows/_publish_to_pypi.yaml +++ /dev/null @@ -1,87 +0,0 @@ -name: Publish to PyPI - -on: - workflow_call: - inputs: - version_number: - required: true - type: string - -jobs: - publish_to_pypi: - name: Publish to PyPI - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write # Required for OIDC authentication. - environment: - name: pypi - url: https://pypi.org/project/apify/ - env: - PYTHON_VERSION: 3.12 - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install dependencies - run: | - pipx install --python ${{ env.PYTHON_VERSION }} poetry - make install-dev - - # Determines the release type based on the event that triggered the workflow. - - name: Determine release type - id: determine-release-type - run: | - if [[ ${{ github.event_name }} = release ]]; then - release_type="final" - elif [[ ${{ github.event_name }} = push ]]; then - release_type="beta" - elif [[ ${{ github.event_name }} = workflow_dispatch ]]; then - release_type=${{ github.event.inputs.release_type }} - fi - echo "release_type=${release_type}" >> $GITHUB_OUTPUT - - # Updates the version number for pre-releases in the project's configuration. - - name: Set pre-release version - if: steps.determine-release-type.outputs.release_type != 'final' - run: python ./scripts/update_version_for_prerelease.py ${{ steps.determine-release-type.outputs.release_type }} - - # Builds the package. - - name: Build package - run: make build - - # Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication. - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - # If this workflow is not triggered by a GitHub release event, manually create and push a Git tag. - - name: Create Git tag with the published version - if: github.event_name != 'release' - run: | - GIT_TAG=v$(python ./scripts/print_current_package_version.py) - echo "Current package version retrieved: ${GIT_TAG}" - - echo "Creating Git tag: ${GIT_TAG}" - git tag "$GIT_TAG" - echo "Git tag ${GIT_TAG} created successfully." - - echo "Pushing Git tag ${GIT_TAG} to the remote repository." - git push origin tag "$GIT_TAG" - echo "Git tag ${GIT_TAG} pushed successfully." - - # If triggered by a release, upload build artifacts to the associated GitHub release. - - name: Upload the build artifacts to release - if: github.event_name == 'release' - run: | - echo "Uploading build artifacts to GitHub release: ${{ github.ref_name }}" - gh release upload ${{ github.ref_name }} dist/* - echo "Build artifacts uploaded successfully." - - env: - GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/_version_conflict_check.yaml b/.github/workflows/_version_conflict_check.yaml index df4580a5..6d119113 100644 --- a/.github/workflows/_version_conflict_check.yaml +++ b/.github/workflows/_version_conflict_check.yaml @@ -3,13 +3,14 @@ name: Version conflict check on: workflow_call: +env: + PYTHON_VERSION: 3.12 + jobs: check_version_conflict: name: Version conflict check runs-on: ubuntu-latest if: (!startsWith(github.event.pull_request.title, 'docs:')) - env: - PYTHON_VERSION: 3.12 steps: - name: Checkout repository diff --git a/.github/workflows/build_and_deploy_docs.yaml b/.github/workflows/build_and_deploy_docs.yaml index 3e7dc146..671e64b3 100644 --- a/.github/workflows/build_and_deploy_docs.yaml +++ b/.github/workflows/build_and_deploy_docs.yaml @@ -6,6 +6,10 @@ on: - master workflow_dispatch: +env: + NODE_VERSION: 20 + PYTHON_VERSION: 3.12 + jobs: build_and_deploy_docs: environment: @@ -15,9 +19,6 @@ jobs: pages: write id-token: write runs-on: ubuntu-latest - env: - NODE_VERSION: 20 - PYTHON_VERSION: 3.12 steps: - name: Checkout repository diff --git a/.github/workflows/run_release.yaml b/.github/workflows/run_release.yaml index 45626a7a..82164516 100644 --- a/.github/workflows/run_release.yaml +++ b/.github/workflows/run_release.yaml @@ -25,13 +25,14 @@ on: - beta - final +env: + PYTHON_VERSION: 3.12 + jobs: should_release: name: Check whether to release if: (!startsWith(github.event.head_commit.message, 'docs:') || github.event_name == 'workflow_dispatch') runs-on: ubuntu-latest - env: - PYTHON_VERSION: 3.12 steps: - name: Dummy step run: "true"