Skip to content

ensure poetry is installed during github workflow execution and cache… #12

ensure poetry is installed during github workflow execution and cache…

ensure poetry is installed during github workflow execution and cache… #12

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
# files in data do not change unless
# repo URL is updated and new file is downloaded
- name: Cache Polygons
id: cache-polygons
uses: actions/cache@v3
with:
path: ./data
key: ${{ runner.os }}-polygons
- name: Build gazetteer
run: |
mkdir -p ./data
poetry run python -B build.py
- name: Changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
env:
REPO: ${{ github.repository }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Upload Gazetteer Asset
id: upload-gazetteer-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./data/gazetteer.json.zip
asset_name: gazetteer.json.zip
asset_content_type: application/zip