Skip to content

Restructure FileIO process #15

Restructure FileIO process

Restructure FileIO process #15

name: matrix-publisher
on:
release:
types:
- published
push:
branches:
- master
paths:
- jarvis/**
- pyproject.toml
workflow_dispatch:
inputs:
dry_run:
type: choice
description: Dry run mode
required: true
options:
- "true"
- "false"
jobs:
pypi-publisher:
runs-on: thevickypedia-lite
strategy:
fail-fast: false
matrix:
project_name:
- jarvis-ironman
- jarvis-bot
- jarvis-nlp
- natural-language-ui
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set dry-run
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "::notice title=DryRun::Setting dry run to ${{ inputs.dry_run }} for '${{ github.event_name }}' event"
echo "dry_run=${{ inputs.dry_run }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "push" ]]; then
echo "::notice title=DryRun::Setting dry run to true for '${{ github.event_name }}' event"
echo "dry_run=true" >> $GITHUB_ENV
else
echo "::notice title=DryRun::Setting dry run to false for '${{ github.event_name }}' event"
echo "dry_run=false" >> $GITHUB_ENV
fi
shell: bash
- name: "Update metadata: ${{ matrix.project_name }}"
run: |
python -m pip install --upgrade pip
python -m pip install toml
python update-toml.py
shell: bash
env:
FILE_PATH: "pyproject.toml"
PROJECT_NAME: "${{ matrix.project_name }}"
- uses: thevickypedia/pypi-publisher@v3
with:
dry-run: ${{ env.dry_run }}
token: ${{ secrets.PYPI_TOKEN }}
checkout: 'false'