Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
name: release
on:
push:
tags: ['v*']
tags:
- 'v*'

permissions:
contents: read
contents: write
packages: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
ghcr:
name: Publish GHCR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compute image name (lowercase)

# Nombre de imagen SIEMPRE en minúsculas
- name: Set image name
shell: bash
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}" >> "$GITHUB_ENV"
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v6
with:
context: .
Expand All @@ -36,20 +37,16 @@ jobs:
tags: ${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.ref_name }}

pypi:
name: Publish PyPI (guarded)
if: ${{ secrets.PYPI_API_TOKEN != '' }}
needs: ghcr
if: ${{ secrets.PYPI_API_TOKEN != '' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: '3.12' }
- name: Build sdist/wheel
run: |
python -m pip install -U pip build
python -m build
with:
python-version: '3.12'
- run: python -m pip install -U pip build
- run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down
Loading