Skip to content

Commit 276dcfe

Browse files
Update CI/CD
1 parent 9c902a8 commit 276dcfe

4 files changed

Lines changed: 43 additions & 46 deletions

File tree

.github/workflows/codeql-analysis.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323

2424
# Initializes the CodeQL tools for scanning.
2525
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@v1
26+
uses: github/codeql-action/init@v2
2727
with:
2828
languages: ${{ matrix.language }}
2929

3030
- name: Autobuild
31-
uses: github/codeql-action/autobuild@v1
31+
uses: github/codeql-action/autobuild@v2
3232

3333
- name: Perform CodeQL Analysis
34-
uses: github/codeql-action/analyze@v1
34+
uses: github/codeql-action/analyze@v2

.github/workflows/docker-publish.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@ jobs:
2525

2626
steps:
2727
- name: Checkout code
28-
uses: nschloe/action-cached-lfs-checkout@v1.1.3
28+
uses: nschloe/action-cached-lfs-checkout@v1.2.3
2929
with:
30-
exclude: "batbot/*/models/pytorch/"
30+
exclude: "examples/example[2-4].wav"
3131

32-
- uses: docker/setup-qemu-action@v1
32+
- uses: docker/setup-qemu-action@v3
3333
name: Set up QEMU
3434
id: qemu
35-
with:
36-
image: tonistiigi/binfmt:latest
37-
platforms: all
3835

39-
- uses: docker/setup-buildx-action@v1
36+
- uses: docker/setup-buildx-action@v3
4037
name: Set up Docker Buildx
4138
id: buildx
4239

@@ -45,10 +42,10 @@ jobs:
4542

4643
# Log into container registries
4744
- name: Login to DockerHub
48-
uses: docker/login-action@v1
45+
uses: docker/login-action@v3
4946
with:
50-
username: batbot
51-
password: ${{ secrets.BATBOT_DOCKER_HUB_TOKEN }}
47+
username: ${{ vars.BATBOT_DOCKERHUB_USERNAME }}
48+
password: ${{ secrets.BATBOT_DOCKERHUB_TOKEN }}
5249

5350
# Push tagged image (version tag + latest) to registries
5451
- name: Tagged Docker Hub

.github/workflows/python-publish.yaml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818

1919
steps:
2020
- name: Checkout code
21-
uses: nschloe/action-cached-lfs-checkout@v1.1.3
21+
uses: nschloe/action-cached-lfs-checkout@v1.2.3
2222
with:
23-
exclude: "batbot/*/models/pytorch/"
23+
exclude: "examples/example[2-4].wav"
2424

25-
- uses: actions/setup-python@v2
26-
name: Install Python
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v6
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929

@@ -33,7 +33,7 @@ jobs:
3333
pip install build
3434
python -m build --wheel --outdir dist/ .
3535
36-
- uses: actions/upload-artifact@v2
36+
- uses: actions/upload-artifact@v6
3737
with:
3838
path: ./dist/*.whl
3939

@@ -42,40 +42,38 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout code
45-
uses: nschloe/action-cached-lfs-checkout@v1.1.3
45+
uses: nschloe/action-cached-lfs-checkout@v1.2.3
4646
with:
47-
exclude: "batbot/*/models/pytorch/"
47+
exclude: "examples/example[2-4].wav"
4848

49-
- uses: actions/setup-python@v2
50-
name: Install Python
49+
- name: Set up Python 3.12
50+
uses: actions/setup-python@v6
5151
with:
52-
python-version: '3.8'
52+
python-version: '3.12'
5353

5454
- name: Build sdist
5555
run: |
5656
pip install --upgrade pip
5757
pip install build
5858
python -m build --sdist --outdir dist/ .
5959
60-
- uses: actions/upload-artifact@v2
60+
- uses: actions/upload-artifact@v6
6161
with:
6262
path: ./dist/*.tar.gz
6363

6464
test_wheel:
6565
needs: [build_wheels, build_sdist]
6666
runs-on: ubuntu-latest
67-
env:
68-
CLASSIFIER_BATCH_SIZE: 16
6967

7068
# test wheel
7169
if: github.event_name == 'push'
7270
steps:
73-
- uses: actions/setup-python@v2
74-
name: Install Python
71+
- name: Set up Python 3.12
72+
uses: actions/setup-python@v6
7573
with:
76-
python-version: '3.8'
74+
python-version: '3.12'
7775

78-
- uses: actions/download-artifact@v2
76+
- uses: actions/download-artifact@v7
7977
with:
8078
name: artifact
8179
path: dist
@@ -88,26 +86,29 @@ jobs:
8886
8987
- name: Test module
9088
run: |
91-
python -c "import batbot; batbot.fetch(); batbot.example();"
89+
python -c "import batbot; batbot.example();"
9290
9391
- name: Test CLI
9492
run: |
95-
batbot fetch
9693
batbot example
9794
9895
upload_pypi:
9996
needs: [test_wheel]
10097
runs-on: ubuntu-latest
10198
# upload to PyPI on every tag starting with 'v'
10299
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
100+
environment:
101+
name: pypi
102+
url: https://pypi.org/p/batbot
103+
permissions:
104+
id-token: write
103105
steps:
104-
- uses: actions/download-artifact@v2
106+
- uses: actions/download-artifact@v7
105107
with:
106108
name: artifact
107109
path: dist
108110

109-
- uses: pypa/gh-action-pypi-publish@release/v1
111+
- name: Publish package distributions to PyPI
112+
uses: pypa/gh-action-pypi-publish@release/v1
110113
with:
111-
user: __token__
112-
password: ${{ secrets.PYPI_PASSWORD }}
113-
# To test: repository_url: https://test.pypi.org/legacy/
114+
password: ${{ secrets.BATBOT_PYPI_TOKEN }}

.github/workflows/testing.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,29 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
# Use the same Python version used the Dockerfile
15-
python-version: [3.9]
15+
python-version: [3.12]
1616

1717
env:
1818
OS: ubuntu-latest
1919
PYTHON: ${{ matrix.python-version }}
20-
CLASSIFIER_BATCH_SIZE: 16
2120

2221
steps:
2322
# Checkout and env setup
2423
- name: Checkout code
25-
uses: nschloe/action-cached-lfs-checkout@v1.1.3
24+
uses: nschloe/action-cached-lfs-checkout@v1.2.3
2625
with:
27-
exclude: "batbot/*/models/pytorch/"
26+
exclude: "examples/example[2-4].wav"
2827

2928
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
29+
uses: actions/setup-python@v6
3130
with:
3231
python-version: ${{ matrix.python-version }}
3332

3433
- name: Install dependencies
3534
run: |
3635
python -m pip install --upgrade pip
37-
pip install -r requirements.txt
38-
pip install -r requirements.optional.txt
36+
pip install -r requirements/runtime.txt
37+
pip install -r requirements/optional.txt
3938
4039
- name: Lint with flake8
4140
run: |
@@ -54,9 +53,9 @@ jobs:
5453
coverage xml
5554
5655
- name: Upload coverage to Codecov
57-
uses: codecov/codecov-action@v1.2.1
56+
uses: codecov/codecov-action@v5
5857
with:
59-
token: ${{ secrets.CODECOV_TOKEN }}
58+
token: ${{ secrets.BATBOT_CODECOV_TOKEN }}
6059
files: ./coverage/coverage.xml
6160
env_vars: OS,PYTHON
6261
fail_ci_if_error: true

0 commit comments

Comments
 (0)