-
Notifications
You must be signed in to change notification settings - Fork 20
53 lines (53 loc) · 1.82 KB
/
release-please.yml
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
on:
push:
branches:
- master
name: release-please
jobs:
list_modules:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: echo "::set-output name=matrix::$(find . -type f -name 'Dockerfile' | awk -F\/ '{print $3"/"$4}' | jq -Rsc '. / "\n" - [""]')"
release-please:
name: release-${{ matrix.subject }}
runs-on: ubuntu-latest
needs: list_modules
strategy:
matrix:
subject: ${{fromJSON(needs.list_modules.outputs.matrix)}}
steps:
- name: Set environment
run: |
echo "PACKAGE_NAME=$( echo "${{ matrix.subject }}" | awk -F\/ '{print "thumbor-plugins-"$2}' )" >> $GITHUB_ENV
- uses: google-github-actions/release-please-action@v3
id: release
with:
monorepo-tags: true
release-type: python
path: thumbor_plugins/${{ matrix.subject }}
package-name: ${{ env.PACKAGE_NAME }}
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-python@v2
if: ${{ steps.release.outputs.releases_created }}
with:
python-version: '3.x'
- name: Build package
if: ${{ steps.release.outputs.releases_created }}
working-directory: ./thumbor_plugins/${{ matrix.subject }}
run: |
pip install -U pip
pip install -U build
python -m build
- name: Publish a Python distribution to PyPI
if: ${{ steps.release.outputs.releases_created }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: thumbor_plugins/${{ matrix.subject }}/dist
skip_existing: true