-
-
Notifications
You must be signed in to change notification settings - Fork 28
46 lines (46 loc) · 1.71 KB
/
python-publish.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
name: Python package
on:
push:
tags:
- "*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# If there isn't a release for this version, create a new one.
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
makeLatest: true
prerelease: false
skipIfReleaseExists: true
# Build and publish the package to pypi.
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
python_version: "3.10"
pypi_token: ${{ secrets.PYPI_TOKEN }}
package_directory: "opshin"
poetry_install_options: "--without dev"
# add executables to the release
- name: Install jq
uses: dcarbone/[email protected]
- name: Trigger executable build
run: |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/opshin/opshin/releases/latest > datafile.json
jq -r '.tag_name' < datafile > tag_name
jq -r '.upload_url' < datafile > upload_url
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/opshin/opshin/dispatches \
-d '{"event_type":"trigger_binary_build","client_payload":{"ref":"'"$(cat tag_name)"'","upload_url":"'"$(cat upload_url)"'"}}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}