matrix-publisher #3
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: matrix-publisher | |
on: | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
description: "Dry run?" | |
type: choice | |
options: | |
- "true" | |
- "false" | |
jobs: | |
publisher: | |
runs-on: thevickypedia-lite | |
strategy: | |
fail-fast: false | |
matrix: | |
project_names: | |
- jarvis-bot | |
- jarvis-nlp | |
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 | |
- name: Set project name to ${{ matrix.project_names }} | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install toml | |
python update-toml.py pyproject.toml "${{ matrix.project_names }}" | |
shell: bash | |
- name: Echo pyproject.toml | |
run: cat pyproject.toml | |
shell: bash | |
- uses: thevickypedia/pypi-publisher@v3 | |
with: | |
dry-run: ${{ env.dry_run }} | |
token: ${{ secrets.PYPI_TOKEN }} |