Repository navigation
61 lines (57 loc) · 1.65 KB
/
Copy pathpython-publish.yaml
File metadata and controls
61 lines (57 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: pypi-publish
on:
release:
types:
- published
push:
branches:
- main
paths:
- '**/*.py'
- '!scripts/**/*.py'
- 'pyproject.toml'
workflow_dispatch:
inputs:
dry_run:
type: choice
description: Dry run mode
required: true
options:
- "true"
- "false"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
pypi-publisher:
runs-on: thevickypedia-default
steps:
- 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
- uses: thevickypedia/pypi-publisher@v3
env:
token: ${{ secrets.PYPI_TOKEN }}
with:
dry-run: ${{ env.dry_run }}
release-notes:
needs: pypi-publisher
if: github.event_name == 'release'
runs-on: thevickypedia-default
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: thevickypedia/update-release-notes@v2
env:
git_token: ${{ secrets.GIT_TOKEN }}