Skip to content

Commit da50c3c

Browse files
committed
Clean up workflow
1 parent 49e9998 commit da50c3c

1 file changed

Lines changed: 65 additions & 99 deletions

File tree

.github/workflows/publish.yml

Lines changed: 65 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -64,71 +64,37 @@ jobs:
6464
- name: Upload wheels and sdist
6565
uses: actions/upload-artifact@v4
6666
with:
67-
name: dist-${{ matrix.os }}
67+
name: dist-wyoming-faster-whisper
6868
path: |
6969
dist/*.whl
7070
dist/*.tar.gz
7171
if-no-files-found: error
7272

7373
# Enables building foreign architectures (e.g., arm64 on amd64 runner)
74-
# - name: Set up QEMU
75-
# uses: docker/setup-qemu-action@v3
76-
77-
# - name: Set up Docker Buildx
78-
# uses: docker/setup-buildx-action@v3
79-
80-
# - name: Log in to DockerHub
81-
# uses: docker/login-action@v3
82-
# with:
83-
# username: ${{ secrets.DOCKERHUB_USERNAME }}
84-
# password: ${{ secrets.DOCKERHUB_TOKEN }}
85-
86-
# - name: Build
87-
# uses: docker/build-push-action@v5
88-
# with:
89-
# context: .
90-
# file: ./Dockerfile
91-
# platforms: linux/amd64,linux/arm64
92-
# push: true
93-
# tags: |
94-
# rhasspy/wyoming-whisper:latest
95-
# rhasspy/wyoming-whisper:${{ steps.read_ver.outputs.tag }}
96-
# cache-from: type=gha
97-
# cache-to: type=gha,mode=max
98-
99-
test:
100-
needs: build
101-
name: Test wheels on ${{ matrix.os }}
102-
runs-on: ${{ matrix.os }}
103-
strategy:
104-
matrix:
105-
os: [ubuntu-latest]
106-
steps:
107-
- uses: actions/checkout@v4
108-
with:
109-
sparse-checkout: tests/
74+
- name: Set up QEMU
75+
uses: docker/setup-qemu-action@v3
11076

111-
- uses: actions/setup-python@v5
112-
with:
113-
python-version: "3.13"
77+
- name: Set up Docker Buildx
78+
uses: docker/setup-buildx-action@v3
11479

115-
- name: Download all dists
116-
uses: actions/download-artifact@v4
80+
- name: Log in to DockerHub
81+
uses: docker/login-action@v3
11782
with:
118-
pattern: dist-*
119-
merge-multiple: true
120-
path: dist
121-
122-
- name: Install wheel
123-
env:
124-
TAG: ${{ needs.build.outputs.tag }}
125-
run: |
126-
python -m pip install pytest pytest-asyncio
127-
python -m pip install --find-links dist/ wyoming-faster-whisper[transformers,sherpa]=="${TAG}"
83+
username: ${{ secrets.DOCKERHUB_USERNAME }}
84+
password: ${{ secrets.DOCKERHUB_TOKEN }}
12885

129-
- name: Test wheel
130-
run: |
131-
python -m pytest tests
86+
- name: Build
87+
uses: docker/build-push-action@v5
88+
with:
89+
context: .
90+
file: ./Dockerfile
91+
platforms: linux/amd64,linux/arm64
92+
push: true
93+
tags: |
94+
rhasspy/wyoming-whisper:latest
95+
rhasspy/wyoming-whisper:${{ steps.read_ver.outputs.tag }}
96+
cache-from: type=gha
97+
cache-to: type=gha,mode=max
13298

13399
changelog:
134100
needs: build
@@ -197,47 +163,47 @@ jobs:
197163
name: release-notes
198164
path: RELEASE_NOTES.md
199165

200-
# publish:
201-
# needs: [build, test, changelog]
202-
# runs-on: ubuntu-latest
203-
# environment: pypi
204-
# permissions:
205-
# id-token: write # required for PyPI Trusted Publishing (OIDC)
206-
# contents: read
207-
# steps:
208-
# - name: Download all dists
209-
# uses: actions/download-artifact@v4
210-
# with:
211-
# pattern: dist-*
212-
# merge-multiple: true
213-
# path: dist
214-
215-
# - name: Publish to PyPI via OIDC
216-
# uses: pypa/gh-action-pypi-publish@release/v1
217-
# with:
218-
# verbose: true
219-
220-
# github_release:
221-
# needs: [build, changelog]
222-
# runs-on: ubuntu-latest
223-
# permissions:
224-
# contents: write
225-
# steps:
226-
# - name: Download all dists
227-
# uses: actions/download-artifact@v4
228-
# with:
229-
# pattern: dist-*
230-
# merge-multiple: true
231-
# path: dist
232-
# - uses: actions/download-artifact@v4
233-
# with:
234-
# name: release-notes
235-
# path: .
236-
# - name: Create GitHub Release
237-
# uses: softprops/action-gh-release@v2
238-
# with:
239-
# tag_name: ${{ github.ref_name }}
240-
# name: ${{ github.ref_name }}
241-
# body_path: RELEASE_NOTES.md
242-
# files: |
243-
# dist/*
166+
publish:
167+
needs: [build, changelog]
168+
runs-on: ubuntu-latest
169+
environment: pypi
170+
permissions:
171+
id-token: write # required for PyPI Trusted Publishing (OIDC)
172+
contents: read
173+
steps:
174+
- name: Download all dists
175+
uses: actions/download-artifact@v4
176+
with:
177+
pattern: dist-*
178+
merge-multiple: true
179+
path: dist
180+
181+
- name: Publish to PyPI via OIDC
182+
uses: pypa/gh-action-pypi-publish@release/v1
183+
with:
184+
verbose: true
185+
186+
github_release:
187+
needs: [build, changelog]
188+
runs-on: ubuntu-latest
189+
permissions:
190+
contents: write
191+
steps:
192+
- name: Download all dists
193+
uses: actions/download-artifact@v4
194+
with:
195+
pattern: dist-*
196+
merge-multiple: true
197+
path: dist
198+
- uses: actions/download-artifact@v4
199+
with:
200+
name: release-notes
201+
path: .
202+
- name: Create GitHub Release
203+
uses: softprops/action-gh-release@v2
204+
with:
205+
tag_name: ${{ github.ref_name }}
206+
name: ${{ github.ref_name }}
207+
body_path: RELEASE_NOTES.md
208+
files: |
209+
dist/*

0 commit comments

Comments
 (0)