-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.72 KB
/
release.yml
File metadata and controls
58 lines (50 loc) · 1.72 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
name: release
run-name: Release by @${{ github.actor }} from ${{ github.ref_name }}
on: [push]
jobs:
release:
if: ${{ github.ref_type == 'branch' }}
uses: nextmv-io/release/.github/workflows/release.yml@develop
with:
BRANCH: ${{ github.ref_name }}
REPOSITORY: nextplot
LANGUAGE: python
PACKAGE_NAME: nextplot
PACKAGE_LOCATION: .
VERSION_FILE: __about__.py
secrets: inherit
publish: # Unfortunately, PyPI publishing does not support reusable workflows, so we must publish here.
needs: release
if: ${{ needs.release.outputs.RELEASE_NEEDED == 'true' }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/nextpipe
permissions:
id-token: write # This is required for trusted publishing to PyPI
steps:
- name: git clone ${{ github.ref_name }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: set up Python
uses: actions/setup-python@v5
- name: install dependencies
run: |
pip install --upgrade pip
pip install build hatch
- name: python - build binary wheel and source tarball
run: python -m build
- name: python - publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist
notify:
needs: [release, publish]
if: ${{ needs.release.outputs.RELEASE_NEEDED == 'true' && needs.release.outputs.SHOULD_NOTIFY_SLACK == 'true' }}
uses: nextmv-io/release/.github/workflows/notify-slack.yml@develop
with:
PACKAGE_NAME: nextplot
VERSION: ${{ needs.release.outputs.VERSION }}
REPOSITORY: nextplot
secrets: inherit