Skip to content

Commit 7c90558

Browse files
committed
ci(release): buildx+qemu; linux/amd64; GHCR lowercase; PyPI guard
1 parent 5fb125e commit 7c90558

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
name: release
22
on:
33
push:
4-
tags: ['v*']
5-
workflow_dispatch:
6-
inputs:
7-
tag:
8-
description: 'Tag to publish (v*)'
9-
required: false
4+
tags: ['v*'] # SOLO tags v*
5+
workflow_dispatch: # manual: no publica PyPI si no hay token
106
permissions:
117
contents: write
128
packages: write
139

1410
jobs:
1511
build-publish:
12+
if: startsWith(github.ref, 'refs/tags/v')
1613
runs-on: ubuntu-latest
1714
steps:
1815
- uses: actions/checkout@v4
1916
- uses: actions/setup-python@v5
2017
with: { python-version: '3.12' }
21-
- name: Build
18+
- name: Build sdist/wheel
2219
run: |
2320
python -m pip install -U pip build
2421
python -m build
@@ -32,14 +29,19 @@ jobs:
3229
password: ${{ secrets.PYPI_API_TOKEN }}
3330

3431
publish-ghcr:
32+
if: startsWith(github.ref, 'refs/tags/v')
3533
needs: build-publish
3634
runs-on: ubuntu-latest
3735
permissions: { contents: read, packages: write }
36+
env:
37+
DOCKER_BUILDKIT: "1"
3838
steps:
3939
- uses: actions/checkout@v4
4040
- name: Compute image name (lowercase)
4141
shell: bash
4242
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}" >> "$GITHUB_ENV"
43+
- uses: docker/setup-qemu-action@v3
44+
- uses: docker/setup-buildx-action@v3
4345
- uses: docker/login-action@v3
4446
with:
4547
registry: ghcr.io
@@ -48,5 +50,8 @@ jobs:
4850
- uses: docker/build-push-action@v6
4951
with:
5052
context: .
53+
file: ./Dockerfile
54+
platforms: linux/amd64
5155
push: true
56+
provenance: false
5257
tags: ${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)