Skip to content

Commit cbd9fd1

Browse files
committed
add workflow dispatch
1 parent 3753348 commit cbd9fd1

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/test-java-bindings-new.yml

+23-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ on:
55
branches: [ "master" ]
66
pull_request:
77
branches: [ "master" ]
8+
workflow_dispatch:
9+
inputs:
10+
ref:
11+
description: 'The reference (branch/tag/commit) to checkout'
12+
required: false
13+
release-type:
14+
type: choice
15+
required: false
16+
default: 'none'
17+
description: 'Indicates whether we want to make a release and if which one'
18+
options:
19+
- release
20+
- none
821

922
env:
1023
CARGO_TERM_COLOR: always
@@ -27,7 +40,9 @@ jobs:
2740
- target: x86_64-pc-windows-gnu
2841
os: windows-latest
2942
steps:
30-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
44+
with:
45+
ref: ${{ inputs.ref || github.ref }}
3146
- name: Install Rust
3247
uses: actions-rs/toolchain@v1
3348
with:
@@ -47,7 +62,6 @@ jobs:
4762
chmod +x .github/scripts/compile_all_targets_java_new.sh
4863
.github/scripts/compile_all_targets_java_new.sh ${{ matrix.target }}
4964
shell: bash
50-
5165
- name: Upload dynamic libs
5266
uses: actions/upload-artifact@v3
5367
with:
@@ -72,13 +86,14 @@ jobs:
7286
os: windows-latest
7387
runs-on: ${{ matrix.os }}
7488
steps:
75-
- uses: actions/checkout@v3
89+
- uses: actions/checkout@v4
90+
with:
91+
ref: ${{ inputs.ref || github.ref }}
7692
- name: Download artifacts
7793
uses: actions/download-artifact@v3
7894
with:
7995
name: ${{ matrix.target }}
8096
path: bindings/java/java_code/src/main/resources/${{ matrix.target }}
81-
8297
- name: Set up JDK
8398
uses: actions/setup-java@v3
8499
with:
@@ -95,13 +110,14 @@ jobs:
95110
name: Merge Artifacts
96111
needs: [build, test]
97112
runs-on: ubuntu-latest
113+
if: ${{ inputs.release-type != 'none' }}
98114
steps:
99-
- uses: actions/checkout@v3
100-
115+
- uses: actions/checkout@v4
116+
with:
117+
ref: ${{ inputs.ref || github.ref }}
101118
- name: Download all artifacts
102119
uses: actions/download-artifact@v3
103120
with:
104121
path: bindings/java/java_code/src/main/resources
105-
106122
- name: List merged artifacts
107123
run: ls -R bindings/java/java_code

0 commit comments

Comments
 (0)