-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (38 loc) · 1.17 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
name: Release
on:
pull_request:
types: [closed]
branches:
- main
jobs:
Release:
name: 🚀 Release
if: github.event.pull_request.merged && startsWith(github.head_ref, 'release-')
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/github-script@v7
with:
script: |
// Getting the release version from the PR source branch
// Source branch looks like this: release-1.0.0
const version = context.payload.pull_request.head.ref.split('-')[1]
core.exportVariable('VERSION', version)
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install poetry
run: pipx install poetry
- name: Build project
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create release on GitHub
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true