Bump pygments from 2.19.2 to 2.20.0 #144
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and publish the package to internal PDBe PyPi registry, Dockerhub and GitLab Container Registry | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| env: | |
| BASE_PYTHON_VERSION: &base_python_version "3.10" | |
| jobs: | |
| build: | |
| name: Lint and Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [*base_python_version, "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync --locked --all-extras --dev | |
| - name: Run pre-commit checks | |
| uses: pre-commit/[email protected] | |
| if: matrix.python-version == env.BASE_PYTHON_VERSION | |
| - name: Run Tests | |
| run: | | |
| uv run make test | |
| publish: | |
| name: Publish | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/pisa-analysis | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "${{ env.BASE_PYTHON_VERSION }}" | |
| - name: Create distribution | |
| run: | | |
| uv build | |
| - name: Publish to internal PyPi | |
| run: | | |
| pip install twine | |
| TWINE_PASSWORD=${{ secrets.TWINE_PASSWORD }} TWINE_USERNAME=${{ secrets.TWINE_USERNAME }} python -m twine upload --repository-url ${{ secrets.PIP_INDEX_URL }} dist/* | |
| - name: Publish to public PyPi | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract Docker tag from GitHub ref | |
| run: echo "DOCKER_TAG=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| platforms: linux/amd64,linux/arm64/v8 | |
| tags: | | |
| ${{ secrets.DOCKER_USERNAME }}/pisa-analysis:${{ env.DOCKER_TAG }} | |
| ${{ secrets.DOCKER_USERNAME }}/pisa-analysis:latest | |
| - name: Login to GitLab Container Registry | |
| run: echo ${{ secrets.REGISTRY_PASSWORD }} | docker login -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin ${{ vars.REGISTRY_URL }} | |
| - name: Build and tag Docker image | |
| run: docker build -t ${{ vars.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/packages/pisa-analysis:latest -t ${{ vars.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/packages/pisa-analysis:${{ env.DOCKER_TAG }} . | |
| - name: Push Docker image to GitLab Container Registry | |
| run: | | |
| docker push ${{ vars.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/packages/pisa-analysis:latest | |
| docker push ${{ vars.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/packages/pisa-analysis:${{ env.DOCKER_TAG }} |