Skip to content

feat: render template when instantiating #5

feat: render template when instantiating

feat: render template when instantiating #5

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Release
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Add Poetry to $PATH
run: |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Add version to environment vars
run: |
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
- name: Check if tag version matches project version
run: |
TAG=$(git describe HEAD --tags --abbrev=0)
echo $TAG
echo $PROJECT_VERSION
if [[ "$TAG" != "v$PROJECT_VERSION" ]]; then exit 1; fi
- name: Get Poetry version
run: poetry --version
- name: Check pyproject.toml validity
run: poetry check --no-interaction
- name: Install deps
run: |
poetry config virtualenvs.in-project true
poetry install --no-interaction
- name: Build
run: poetry build
- name: Create Release Draft
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
dist/jinja2_components-${{env.PROJECT_VERSION}}-py3-none-any.whl
dist/jinja2_components-${{env.PROJECT_VERSION}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}