Skip to content

fix: cicd

fix: cicd #1

Workflow file for this run

name: CD
on:
push:
tags:
- v**
defaults:
run:
shell: bash
jobs:
deploy:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2.3.1
with:
python-version: "3.10"
- id: cache-dependencies
name: Cache dependencies
uses: actions/cache@v2.1.7
with:
path: ${{ github.workspace }}/.venv
key: dependencies-${{ hashFiles('**/poetry.lock') }}
restore-keys: dependencies-
- name: Install dependencies
if: steps.cache-dependencies.cache-hit != 'true'
run: |
python -m pip install -U pip poetry
poetry --version
poetry check --no-interaction
poetry config virtualenvs.in-project true
poetry install --no-interaction
- name: Add version to environment
run: |
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
- name: Run tests
run: |
poetry run pytest -v
- name: Build artifacts
run: |
poetry build --no-interaction
- name: Generate Release Notes
run: |
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty='format:* %h %s' --no-merges >> ".github/release_template.md"
- name: Create Release Draft
uses: softprops/action-gh-release@v1
with:
body_path: ".github/release_template.md"
draft: true
files: |
dist/application-${{env.PROJECT_VERSION}}-py3-none-any.whl
dist/application-${{env.PROJECT_VERSION}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}