Merge pull request #7 from opensourceworks-org/ci/python-versions #6
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: Publish Python Package | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Rye | |
run: curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash | |
- name: Add Rye to PATH | |
shell: bash | |
run: echo "$HOME/.rye/shims" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: make install | |
# need to fix moto_server | |
- name: Run tests | |
shell: bash | |
run: | | |
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH | |
which moto_server | |
pwd | |
- name: Build package | |
run: make build | |
- name: Publish package | |
if: matrix.python-version == '3.10' | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
REPOSITORY_URL: ${{ vars.REPOSITORY_URL }} | |
run: make publish-ci |