Skip to content

Bump actions/upload-artifact from 4.0.0 to 4.1.0 #1870

Bump actions/upload-artifact from 4.0.0 to 4.1.0

Bump actions/upload-artifact from 4.0.0 to 4.1.0 #1870

Workflow file for this run

name: build
on:
push:
release:
types: [created, published]
env:
python-version: '3.12'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ env.python-version }}
- name: Lint with pre-commit
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0
- name: Check Poetry lock file integrity
run: |
python${{ env.python-version }} -m pip install --constraint=.github/constraints.txt poetry
poetry config virtualenvs.in-project true
poetry check
build:
needs: lint
runs-on: ubuntu-22.04
permissions:
contents: write
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
name: build python ${{ matrix.python-version }}
outputs:
targz: gaphas-${{ steps.meta.outputs.version }}.tar.gz
wheel: gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Use Python Dependency Cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Ubuntu Dependencies
run: |
sudo apt update -qq
sudo apt install -qq --no-install-recommends gir1.2-gtk-4.0 libgirepository1.0-dev
- name: Install Poetry
run: |
python${{ matrix.python-version }} -m pip install --constraint=.github/constraints.txt poetry
poetry config virtualenvs.in-project true
- name: Collect Project Data
id: meta
run: .github/scripts/metadata.sh
- name: Install dependencies
run: poetry install --no-interaction
- name: Test
run: xvfb-run poetry run pytest --cov=gaphas
- name: Code Climate Coverage Action
uses: paambaati/codeclimate-action@a1831d7162ea1fbc612ffe5fb3b90278b7999d59 # v5.0.0
env:
CC_TEST_REPORTER_ID: 195e9f83022747c8eefa3ec9510dd730081ef111acd99c98ea0efed7f632ff8a
with:
coverageCommand: poetry run coverage xml
- name: Create Source Dist and Wheel
if: ${{ matrix.python-version == env.python-version }}
run: poetry build
- name: Upload gaphas-${{ steps.meta.outputs.version }}.tar.gz
if: ${{ matrix.python-version == env.python-version }}
uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0
with:
name: gaphas-${{ steps.meta.outputs.version }}.tar.gz
path: dist/gaphas-${{ steps.meta.outputs.version }}.tar.gz
- name: Upload gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl
if: ${{ matrix.python-version == env.python-version }}
uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0
with:
name: gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl
path: dist/gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl
publish-to-pypi:
name: Publish to PyPI (release only)
needs: build
runs-on: ubuntu-22.04
permissions:
id-token: write
if: ${{ github.event_name == 'release' }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: ${{ needs.build.outputs.targz }}
path: dist
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: ${{ needs.build.outputs.wheel }}
path: dist
- uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # release/v1