chore(ci): Update release workflow #5
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 | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
check-branch: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
concurrency: | ||
group: check-pr-${{ github.ref }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniconda-version: "latest"dev | ||
environment-file: conda/release.yaml | ||
channels: conda-forge,nodefaults | ||
activate-environment: pydantic-to-django-model-release | ||
auto-update-conda: true | ||
conda-solver: libmamba | ||
- name: Create file with environment variables | ||
run: touch .env | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Update npm | ||
run: npm -g update npm | ||
- name: Run semantic release (for tests) | ||
if: ${{ github.event_name != 'workflow_dispatch' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: makim release.dry | ||
- name: Release command | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
makim release.ci | ||
- name: Generate documentation with changes from semantic-release | ||
run: makim docs.build | ||
- name: GitHub Pages action | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build |