File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 18
18
- name : Get release version
19
19
id : get_release
20
20
run : |
21
- export VERSION=$(curl -sSL https://api.github.com/repos/CITCOM-project/CausalTestingFramework/releases/latest | jq -r '.tag_name' | head -c 2)
22
- echo "::set-output name=version::$VERSION"
21
+ # Extract the version without the 'v' prefix using regex
22
+ export VERSION=$(curl -sSL https://api.github.com/repos/CITCOM-project/CausalTestingFramework/releases/latest | jq -r '.tag_name' | sed -E 's/^v?([0-9]+(\.[0-9]+)?).*/\1/')
23
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
23
24
24
25
build_and_upload :
25
26
name : Docker Build
@@ -44,22 +45,22 @@ jobs:
44
45
python -m pip install causal-testing-framework -e .[dev]
45
46
python -m pip install dafni-cli
46
47
47
- - name : Run tests before uploading
48
+ - name : Check if unit tests are passing first
48
49
id : tests
49
- run : |
50
- python -m pytest ./dafni/tests
50
+ uses : ./.github/workflows/ci-tests.yml
51
51
52
52
- name : Build the container
53
- if : steps.tests.outcome == 'success'
53
+ if : success() && steps.tests.outcome == 'success'
54
54
run : |
55
55
docker build -t ctf:${{ env.VERSION }} -f ./dafni/Dockerfile .
56
56
docker save ctf:${{ env.VERSION }} | gzip > ctf-dafni-${{ env.VERSION }}.tar.gz
57
57
58
+
58
59
- name : Log into DAFNI
59
60
run : |
60
61
dafni login
61
62
62
63
- name : Upload to DAFNI
63
64
run : |
64
- dafni upload model ./dafni/model_definition.yaml ctf-dafni-${{ env.VERSION }}.tar.gz --version-message "Causal Testing Framework ${{ env.VERSION }}. Uploaded via Github Actions." --parent-id ${{ env.DAFNI_PARENT_ID }} -y
65
- dafni logout
65
+ dafni upload model ./dafni/model_definition.yaml ctf-dafni-${{ env.VERSION }}.tar.gz --version-message "Causal Testing Framework v ${{ env.VERSION }}. Uploaded via Github Actions." --parent-id ${{ env.DAFNI_PARENT_ID }} -y
66
+ dafni logout
You can’t perform that action at this time.
0 commit comments