Skip to content

Commit e7c8d3c

Browse files
committed
fix: clean up unnecessary code
1 parent 058d6ea commit e7c8d3c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/publish-to-dafni.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
release:
66
types: [published]
77

8-
98
jobs:
109

1110
build_and_upload:
@@ -16,17 +15,25 @@ jobs:
1615
DAFNI_PARENT_ID: ${{ secrets.DAFNI_PARENT_ID }}
1716
DAFNI_USERNAME: ${{ secrets.DAFNI_USERNAME }}
1817
DAFNI_PASSWORD: ${{ secrets.DAFNI_PASSWORD }}
19-
CTF_VERSION: ${{ github.event.release.tag_name }}
2018

2119
steps:
2220
- uses: actions/checkout@v3
2321
- uses: actions/setup-python@v3
2422
with:
2523
python-version: 3.9
24+
25+
- name: Set CTF_VERSION and VERSION
26+
run: |
27+
TAG=${{ github.event.release.tag_name }}
28+
CTF_VERSION="$TAG"
29+
VERSION=$(echo "$TAG" | sed 's/v//; s/\.[0-9]*$//')
30+
echo "CTF_VERSION=${CTF_VERSION}" >> $GITHUB_ENV
31+
echo "VERSION=v${VERSION}" >> $GITHUB_ENV
32+
2633
- name: Build the container
2734
run: |
28-
docker build -t ctf:gh -f ./dafni/Dockerfile .
29-
docker save ctf:gh | gzip > ctf-gh.tar.gz
35+
docker build -t ctf:VERSION -f ./dafni/Dockerfile .
36+
docker save ctf:VERSION | gzip > ctf-${VERSION}.tar.gz
3037
3138
- name: Install DAFNI-CLI and log in
3239
run: |
@@ -35,5 +42,5 @@ jobs:
3542
3643
- name: Upload to DAFNI
3744
run: |
38-
dafni upload model ./dafni/model_definition.yaml ctf-gh.tar.gz --version-message "Version ${CTF_VERSION}. Uploaded via Github." --parent-id ${DAFNI_PARENT_ID} -y
45+
dafni upload model ./dafni/model_definition.yaml ctf-${VERSION}.tar.gz --version-message "Version ${CTF_VERSION}. Uploaded via Github." --parent-id ${DAFNI_PARENT_ID} -y
3946
dafni logout

0 commit comments

Comments
 (0)