-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (56 loc) · 1.77 KB
/
release.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
name: Run Release Please
on:
workflow_dispatch:
inputs:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main
signoff: "OpenFeature Bot <[email protected]>"
- name: Dump Release Please Output
env:
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
run: |
echo "$RELEASE_PLEASE_OUTPUT"
outputs:
release_created: ${{ steps.release.outputs.releases_created }}
all: ${{ toJSON(steps.release.outputs) }}
paths_released: ${{ steps.release.outputs.paths_released }}
pypi-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
strategy:
matrix:
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing to pypi
id-token: write
container:
image: "python:3.12"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Upgrade pip
run: pip install --upgrade pip
- name: Install hatch
run: pip install hatch
- name: Build a binary wheel and a source tarball
run: hatch build
working-directory: ${{ matrix.path }}
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ matrix.path }}/dist