Skip to content

Commit 1f85235

Browse files
ci(release): fix invalid YAML; GHCR-only on tags (#59)
1 parent a80437f commit 1f85235

File tree

1 file changed

+11
-30
lines changed

1 file changed

+11
-30
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,37 @@
11
name: release
22
on:
33
push:
4-
tags: ['v*']
4+
tags:
5+
- 'v*' # only version tags
56

67
permissions:
78
contents: read
89
packages: write
910

10-
concurrency:
11-
group: release-${{ github.ref }}
12-
cancel-in-progress: true
13-
1411
jobs:
1512
ghcr:
16-
name: Publish GHCR
1713
runs-on: ubuntu-latest
1814
steps:
1915
- uses: actions/checkout@v4
20-
- name: Compute image name (lowercase)
16+
17+
- name: Set image name (lowercase)
2118
shell: bash
22-
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}" >> "$GITHUB_ENV"
23-
- uses: docker/setup-qemu-action@v3
19+
run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
20+
2421
- uses: docker/setup-buildx-action@v3
2522
- uses: docker/login-action@v3
2623
with:
2724
registry: ghcr.io
2825
username: ${{ github.actor }}
2926
password: ${{ secrets.GITHUB_TOKEN }}
27+
3028
- uses: docker/build-push-action@v6
3129
with:
3230
context: .
31+
file: ./Dockerfile
3332
platforms: linux/amd64
3433
push: true
3534
provenance: false
36-
tags: ${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.ref_name }}
37-
38-
pypi:
39-
name: Publish PyPI (guarded)
40-
if: ${{ secrets.PYPI_API_TOKEN != '' }}
41-
needs: ghcr
42-
runs-on: ubuntu-latest
43-
permissions:
44-
contents: read
45-
steps:
46-
- uses: actions/checkout@v4
47-
- uses: actions/setup-python@v5
48-
with: { python-version: '3.12' }
49-
- name: Build sdist/wheel
50-
run: |
51-
python -m pip install -U pip build
52-
python -m build
53-
- uses: pypa/gh-action-pypi-publish@release/v1
54-
with:
55-
user: __token__
56-
password: ${{ secrets.PYPI_API_TOKEN }}
35+
tags: |
36+
${{ env.IMAGE }}:latest
37+
${{ env.IMAGE }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)