Publish (pypi) #20
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 (pypi) | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish | |
- name: Install Flit | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: bash dev/setup.sh | |
- name: Publish | |
env: | |
# SEE https://packaging.python.org/en/latest/specifications/pypirc/?highlight=token#using-a-pypi-token | |
FLIT_USERNAME: __token__ | |
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: bash dev/publish.sh "pypi" | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
test-published-package: | |
needs: | |
- publish | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Install packages | |
run: | | |
python3 -m pip install -U dbt-artifacts-parser | |
- name: Test pacakge | |
run: | | |
python -c 'import dbt_artifacts_parser; print(dbt_artifacts_parser.__version__)' |