Skip to content

Commit ed48007

Browse files
authored
[CI] ADD is_nightly parameter (#238)
* [CI] ADD nightly parameter * [CI] FIX variable PROJECT_NAME
1 parent 767a713 commit ed48007

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: CI
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
is_nightly:
7+
description: 'Is this a nightly build?'
8+
required: false
9+
default: false
10+
type: boolean
511
pull_request:
612
push:
713

@@ -28,6 +34,19 @@ jobs:
2834
with:
2935
path: ${{ env.WORKSPACE_SRC_PATH }}
3036

37+
- name: Set env vars for artifacts naming
38+
shell: bash
39+
run: |
40+
PROJECT_NAME="${GITHUB_REPOSITORY#*/}"
41+
echo "PROJECT_NAME=$PROJECT_NAME" | tee -a $GITHUB_ENV
42+
43+
ARTIFACT_VERSION="${{ steps.sofa.outputs.run_branch }}"
44+
if [[ "${{ github.event.inputs.is_nightly }}" == "true" ]]; then
45+
ARTIFACT_VERSION="${ARTIFACT_VERSION}-nightly"
46+
fi
47+
ARTIFACT_NAME="${PROJECT_NAME}_${ARTIFACT_VERSION}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}"
48+
echo "ARTIFACT_NAME=$ARTIFACT_NAME" | tee -a $GITHUB_ENV
49+
3150
- name: Set env vars for pybind11 installation
3251
shell: bash
3352
run: |
@@ -133,13 +152,13 @@ jobs:
133152
- name: Create artifact
134153
uses: actions/upload-artifact@v2
135154
with:
136-
name: SofaPython3_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
155+
name: ${{ env.ARTIFACT_NAME }}
137156
path: ${{ env.WORKSPACE_INSTALL_PATH }}
138157

139158
- name: Install artifact
140159
uses: actions/download-artifact@v2
141160
with:
142-
name: SofaPython3_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}
161+
name: ${{ env.ARTIFACT_NAME }}
143162
path: ${{ env.WORKSPACE_ARTIFACT_PATH }}
144163

145164
- name: Set env vars for tests
@@ -215,13 +234,15 @@ jobs:
215234
with:
216235
path: artifacts
217236

218-
- name: Zip artifacts
237+
- name: Zip artifacts and set env vars
219238
shell: bash
220239
run: |
221240
cd $GITHUB_WORKSPACE/artifacts
222241
for artifact in *; do
223242
zip $artifact.zip -r $artifact/*
224243
done
244+
PROJECT_NAME="${GITHUB_REPOSITORY#*/}"
245+
echo "PROJECT_NAME=$PROJECT_NAME" | tee -a $GITHUB_ENV
225246
226247
- name: Upload release
227248
uses: softprops/action-gh-release@v1
@@ -230,7 +251,7 @@ jobs:
230251
tag_name: release-${{ github.ref_name }}
231252
fail_on_unmatched_files: true
232253
files: |
233-
artifacts/SofaPython3_*_Linux.zip
234-
artifacts/SofaPython3_*_Windows.zip
235-
artifacts/SofaPython3_*_macOS.zip
254+
artifacts/${{ env.PROJECT_NAME }}_*_Linux.zip
255+
artifacts/${{ env.PROJECT_NAME }}_*_Windows.zip
256+
artifacts/${{ env.PROJECT_NAME }}_*_macOS.zip
236257

0 commit comments

Comments
 (0)