Merge pull request #143 from openstates/create-os-core-metadata-package #47
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: Release Steps | |
on: | |
push: | |
tags: | |
- '*' | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3 | |
with: | |
# Retrieves all commit history for path filter checking | |
fetch-depth: 0 | |
- name: setup Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: install GDAL and python bindings | |
run: sudo apt update && sudo apt-get install -y gdal-bin python3-gdal | |
- name: install Poetry | |
uses: snok/[email protected] | |
- name: configure pypi credentials | |
run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" | |
- name: Publish core package | |
run: poetry publish --build | |
- name: install dependencies | |
run: poetry install | |
- name: update metadata | |
env: | |
DATABASE_URL: ${{ secrets.OPENSTATES_DATABASE_URL }} | |
run: poetry run os-initdb | |
# Add steps for openstates_metadata package | |
- name: Create directory and copy openstates_metadata | |
run: | | |
mkdir -p core_metadata | |
cp -r openstates/metadata core_metadata | |
- name: Change directory to core_metadata | |
run: cd core_metadata | |
- name: Move configuration files | |
run: | | |
mv metadata/pyproject.toml.sample pyproject.toml | |
mv metadata/.python-version.sample .python-version | |
mv metadata/README.md.sample README.md | |
mv metadata openstates_metadata | |
- name: Install dependencies for openstates_metadata | |
run: poetry install | |
- name: Configure pypi credentials for metadata package | |
run: poetry config pypi-token.pypi "${{ secrets.OPENSTATES_METADATA_PYPI_API_KEY }}" | |
- name: Publish openstates_metadata package | |
run: poetry publish --build |