File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1- name : build, test and release sqlite-vector
1+ name : Build, Test and Release
22on :
33 push :
44 workflow_dispatch :
Original file line number Diff line number Diff line change 77 description : " Version to use for the Python package (e.g. 0.9.9)"
88 required : true
99 type : string
10- release :
11- types : [released]
10+ workflow_run :
11+ workflows : ["Build, Test and Release"]
12+ types :
13+ - completed
1214
1315jobs :
1416 build-and-publish :
17+ if : |
18+ github.event_name == 'workflow_dispatch' ||
19+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')
1520 runs-on : ${{ matrix.os }}
1621 permissions :
1722 id-token : write # mandatory for Pypi trusted publishing
6570 - name : Get version
6671 id : get_version
6772 run : |
68- if [[ "${{ github.event_name }}" == "release" ]]; then
69- VERSION="${{ github.event.release.tag_name }}"
73+ if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
74+ # Fetch latest published release tag from GitHub API
75+ VERSION=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
7076 else
7177 VERSION="${{ github.event.inputs.version }}"
7278 fi
You can’t perform that action at this time.
0 commit comments