API key for semantic scholar (#7) #1
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: Build and Publish Package to Pypi | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.8.3 | |
- name: Install Packages | |
run: poetry install --with dev,docs | |
- name: Build coverage file | |
run: | | |
poetry run pytest | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12" | |
- name: Setup Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.8.3 | |
- name: Install dependencies | |
run: | | |
poetry --version | |
poetry install | |
- name: Build and publish | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
env: | |
PYPI_USERNAME: __token__ | |
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD |