-
-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (35 loc) · 1.09 KB
/
release.yml
File metadata and controls
41 lines (35 loc) · 1.09 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
name: Run tests and release
on:
push:
tags:
- "*"
workflow_dispatch:
workflow_call:
jobs:
build-python-wheel:
name: "🐍 Python Wheel"
uses: ./.github/workflows/wheel.yml
secrets: inherit
release-pypi:
name: "🐍 Release on PyPI"
runs-on: ubuntu-latest
needs: [build-python-wheel]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/p/${{ github.event.repository.name }}
permissions:
id-token: write
contents: write
steps:
- name: Retrieve artifact from Python build
uses: actions/download-artifact@v8
with:
name: python_wheel
path: dist/
- name: upload release asset
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload --repo ${{ github.repository_owner }}/${{ github.event.repository.name }} ${{ github.ref_name }} "dist/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz"
- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@release/v1