Skip to content

Commit f4470ec

Browse files
Merge pull request #370 from ftsrg/zenodo-publish
Added zenodo uploading to chain of releases
2 parents bfe8367 + a58f510 commit f4470ec

File tree

4 files changed

+165
-2
lines changed

4 files changed

+165
-2
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: 'Create zenodo release'
2+
description: 'Create release and deploy JARs'
3+
inputs:
4+
tool:
5+
required: true
6+
prevrecord:
7+
required: true
8+
runs:
9+
using: "composite"
10+
steps:
11+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
12+
with:
13+
fetch-depth: 0
14+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v3.0.2
15+
with:
16+
name: ThetaJars
17+
path: jar/
18+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v3.0.2
19+
with:
20+
name: ${{inputs.tool}}_SV-COMP
21+
path: upload/
22+
23+
- run: |
24+
url='https://zenodo.org/records/${{inputs.prevrecord}}'
25+
token='${{secrets.zenodo_token}}'
26+
file='${{inputs.tool}}'
27+
RECORD_ID=$(basename "$url")
28+
echo "Creating new version for record $RECORD_ID"
29+
30+
NEW_VERSION=$(curl --silent -X POST \
31+
-H "Authorization: Bearer $token" \
32+
"https://zenodo.org/api/deposit/depositions/$RECORD_ID/actions/newversion")
33+
34+
NEW_VERSION_URL=$(echo "$NEW_VERSION" | jq -r '.links.bucket')
35+
PUBLISH_URL=$(echo "$NEW_VERSION" | jq -r '.links.publish')
36+
DEPOSITION_ID=$(echo "$NEW_VERSION" | jq -r '.links.self')
37+
38+
if [ "$NEW_VERSION_URL" == "null" ]; then
39+
echo "Failed to create new version. Message: $NEW_VERSION"
40+
exit 1
41+
fi
42+
43+
echo "New bucket URL: $NEW_VERSION_URL"
44+
45+
FILE="upload/$file.zip"
46+
if [ ! -f "$FILE" ]; then
47+
echo "File not found: $FILE"
48+
exit 1
49+
fi
50+
51+
TODAY=$(date +'%Y-%m-%d')
52+
curl --silent --fail -X PUT \
53+
-H "Content-Type: application/json" \
54+
-H "Authorization: Bearer $token" \
55+
--data "$(sed 's/__TODAY__/'$TODAY'/g;s/__TOOL__/'$file'/g' ${{github.action_path}}/metadata.json)" \
56+
"$DEPOSITION_ID" \
57+
|| { echo "Metadata update failed"; exit 1; }
58+
59+
echo "Metadata update succeeded (date := $TODAY)"
60+
61+
curl --fail --silent -H "Authorization: Bearer $token" --upload-file "$FILE" "$NEW_VERSION_URL"/"$file.zip" || { echo "Upload failed"; exit 1; }
62+
63+
echo "Upload successful"
64+
65+
echo curl --fail --silent -X POST -H "Authorization: Bearer $token" "$PUBLISH_URL"
66+
67+
curl --fail --silent -X POST -H "Authorization: Bearer $token" "$PUBLISH_URL" || { echo "Publish failed"; exit 1; }
68+
69+
echo "Publish successful"
70+
shell: bash
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"metadata": {
3+
"title": "__TOOL__ - Verifier Archive",
4+
"publication_date": "__TODAY__",
5+
"access_right": "open",
6+
"creators": [
7+
{
8+
"name": "Bajczi, Levente",
9+
"affiliation": "Budapest University of Technology and Economics",
10+
"orcid": "0000-0002-6551-5860"
11+
},
12+
{
13+
"name": "Telbisz, Csan\u00e1d",
14+
"affiliation": "Budapest University of Technology and Economics",
15+
"orcid": "0000-0002-6260-5908"
16+
},
17+
{
18+
"name": "Somorjai, M\u00e1rk",
19+
"affiliation": "Budapest University of Technology and Economics",
20+
"orcid": "0000-0001-7537-0469"
21+
},
22+
{
23+
"name": "\u00c1d\u00e1m, Zs\u00f3fia",
24+
"affiliation": "Budapest University of Technology and Economics",
25+
"orcid": "0000-0003-2354-1750"
26+
},
27+
{
28+
"name": "Dobos-Kov\u00e1cs, Mih\u00e1ly",
29+
"affiliation": "Budapest University of Technology and Economics",
30+
"orcid": "0000-0002-0064-2965"
31+
},
32+
{
33+
"name": "Szekeres, D\u00e1niel",
34+
"affiliation": "Budapest University of Technology and Economics",
35+
"orcid": "0000-0002-2912-028X"
36+
},
37+
{
38+
"name": "Mondok, Mil\u00e1n",
39+
"affiliation": "Budapest University of Technology and Economics",
40+
"orcid": "0000-0001-5396-2172"
41+
},
42+
{
43+
"name": "Moln\u00e1r, Vince",
44+
"affiliation": "Budapest University of Technology and Economics"
45+
}
46+
],
47+
"custom": {
48+
"code:codeRepository": "https://github.com/ftsrg/theta",
49+
"code:programmingLanguage": [
50+
{
51+
"id": "java",
52+
"title": {
53+
"en": "Java"
54+
}
55+
},
56+
{
57+
"id": "kotlin",
58+
"title": {
59+
"en": "Kotlin"
60+
}
61+
}
62+
]
63+
},
64+
"license": "cc-by-4.0",
65+
"imprint_publisher": "Zenodo",
66+
"upload_type": "software"
67+
}
68+
}

.github/workflows/linux-build-test-deploy.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
needs: [build, create-spec-transformation]
101101
strategy:
102102
matrix:
103-
tool: [Theta, EmergenTheta, Thorn]
103+
tool: [Theta, EmergenTheta, Thorn, ThetaCHC]
104104
include:
105105
- tool: Theta
106106
script: theta-start.sh
@@ -183,6 +183,31 @@ jobs:
183183
with:
184184
message: ${{ inputs.message }}
185185

186+
deploy-zenodo:
187+
needs: [test-linux, create-archives]
188+
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
189+
runs-on: ubuntu-24.04
190+
strategy:
191+
matrix:
192+
tool: [Theta, EmergenTheta, Thorn, ThetaCHC]
193+
include:
194+
- tool: Theta
195+
record: 14194483
196+
- tool: EmergenTheta
197+
record: 15536866
198+
- tool: Thorn
199+
record: 14194485
200+
- tool: ThetaCHC
201+
record: 15537027
202+
steps:
203+
- name: Checkout repository
204+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
205+
- name: Create zenodo release and deploy tools
206+
uses: ./.github/actions/zenodo-release
207+
with:
208+
tool: ${{matrix.tool}}
209+
precrecord: ${{matrix.record}}
210+
186211
deploy-maven:
187212
# needs: test-linux
188213
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildscript {
2929

3030
allprojects {
3131
group = "hu.bme.mit.theta"
32-
version = "6.15.3"
32+
version = "6.15.4"
3333

3434

3535
apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts"))

0 commit comments

Comments
 (0)