Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #142
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/CD | |
on: push | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set package version | |
run: sed -i "s/^version.*/version = ${GITHUB_REF#refs/*/}/" setup.cfg | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
- name: Update build tools | |
run: python3 -m pip install -U pip && python3 -m pip install -U build wheel | |
- name: Build package | |
run: python3 -m build | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
python-version: [3.6, 3.7, 3.8, 3.9] | |
steps: | |
- name: Install system deps | |
run: sudo apt-get update -y && sudo apt-get install -y pulseaudio | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
name: dist | |
path: dist | |
- name: Install package | |
run: pip3 install "$(echo dist/*.whl)[all]" | |
- name: Install test packages | |
run: pip3 install 'sage-data-client==0.4.*' | |
- name: Test package | |
run: python3 -m unittest discover tests | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
name: dist | |
path: dist | |
- name: Update publish tools | |
run: python3 -m pip install -U pip && python3 -m pip install -U twine | |
- name: Publish package to test PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: python -m twine upload dist/* | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* |