Update GitHub actions

dependabot/pip/json-stream-gte-2.5.1-and-lt-3
alufers 4 months ago
parent 594897aa7e
commit 60c2f91025

@ -20,24 +20,24 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d uses: docker/login-action@v4
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker - name: Extract metadata (tags, labels) for Docker
id: meta id: meta
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c uses: docker/metadata-action@v6
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: | flavor: |
latest=auto latest=auto
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c uses: docker/setup-buildx-action@v4
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 uses: docker/build-push-action@v7
with: with:
context: . context: .
push: true push: true

@ -4,7 +4,7 @@ on:
inputs: inputs:
release-type: release-type:
type: choice type: choice
description: 'Release type (one of): patch, minor, major, prepatch, preminor, premajor, prerelease' description: 'Release type (one of): patch, minor, major'
default: 'patch' default: 'patch'
options: options:
- 'patch' - 'patch'
@ -12,29 +12,27 @@ on:
- 'major' - 'major'
required: true required: true
permissions:
contents: write
packages: write
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Checkout project repository - uses: actions/checkout@v6
- uses: actions/checkout@v4
- name: Set up Python 3.14 - name: Set up Python 3.14
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: "3.14" python-version: "3.14"
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@v8
with: with:
version: "latest" version: "latest"
- name: Install dependencies - name: Install dependencies
run: | run: uv sync
uv sync
- name: Run Python lint checks
run: |
uv run prek run --all-files
- name: Run Python tests - name: Run Python tests
run: | run: uv run pytest --cov
uv run pytest --cov
- name: Git configuration - name: Git configuration
run: | run: |
git config --global user.email "bot@example.com" git config --global user.email "bot@example.com"
@ -43,9 +41,7 @@ jobs:
run: | run: |
uvx hatch version ${{ github.event.inputs.release-type }} uvx hatch version ${{ github.event.inputs.release-type }}
echo "NEW_VERSION=$(uvx hatch version)" >> $GITHUB_ENV echo "NEW_VERSION=$(uvx hatch version)" >> $GITHUB_ENV
env: - name: Update lock file and build package
RELEASE_TYPE: ${{ github.event.inputs.release-type }}
- name: Build package
run: | run: |
uv lock uv lock
uv build uv build
@ -54,26 +50,25 @@ jobs:
git add pyproject.toml uv.lock git add pyproject.toml uv.lock
git commit -m "chore: release ${{ env.NEW_VERSION }}" git commit -m "chore: release ${{ env.NEW_VERSION }}"
git tag ${{ env.NEW_VERSION }} git tag ${{ env.NEW_VERSION }}
git push origin master git push origin master --follow-tags
- name: Build docker image - name: Publish package to PyPI
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc run: uv publish
with:
context: .
push: false
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Push repository changes
- name: Publish package
run: |
uv publish
env: env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Push docker image - name: Log in to the Container registry
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push Docker image
uses: docker/build-push-action@v7
with: with:
context: . context: .
push: false push: true
platforms: linux/amd64 platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }} tags: |
labels: ${{ steps.meta.outputs.labels }} ghcr.io/${{ github.repository }}:${{ env.NEW_VERSION }}
ghcr.io/${{ github.repository }}:latest

Loading…
Cancel
Save