docs: Update CI badge to use shields.io and match style #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
env: | |
PYTHON_RELEASE_VERSION: "3.10" | |
jobs: | |
test: | |
name: Run Tests (Python ${{ matrix.python-version }}) | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Bats | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y bats | |
- name: Install the application | |
run: pip install . | |
- name: Run Bats tests | |
run: bats tests/ | |
release-windows: | |
name: Release Windows | |
runs-on: windows-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.PYTHON_RELEASE_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_RELEASE_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py install | |
pip install pyinstaller | |
- name: build with pyinstaller | |
run: | | |
pyinstaller hathitrustdownloader/cli.py --name downloader | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
shell: bash | |
- name: ZIP the Windows release artifacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: Compress-Archive -Path dist/downloader downloader_${{ env.VERSION }}_win.zip | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
generate_release_notes: true | |
files: downloader_${{ env.VERSION }}_win.zip | |
release-pip: | |
name: Release to PyPI | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.PYTHON_RELEASE_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_RELEASE_VERSION }} | |
- name: Install Tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
shell: bash | |
- name: Package and Upload | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
HATHITRUST_DOWNLOADER_VERSION: ${{ env.VERSION }} | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* |