-
Notifications
You must be signed in to change notification settings - Fork 141
73 lines (61 loc) · 1.77 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
on:
push:
branches:
- master
name: release-please
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- name: Release Please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
build-and-publish:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
environment:
name: pypi
url: https://pypi.org/p/pikaraoke
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Cache Poetry Install
id: cache-poetry
uses: actions/cache@v4
with:
path: |
/opt/poetry
~/.cache/pypoetry
.venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/pyproject.toml')
}}
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
export POETRY_HOME=/opt/poetry
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.8.2
$POETRY_HOME/bin/poetry --version
- name: Add Poetry to PATH
run: echo "/opt/poetry/bin" >> $GITHUB_PATH
- name: Install Package
run: poetry install --no-interaction --no-ansi
- name: Build Package
run: poetry build
- name: Publish Python 🐍 distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1