@@ -112,28 +112,37 @@ jobs:
112112 username : ${{ github.actor }}
113113 password : ${{ secrets.GITHUB_TOKEN }}
114114
115- # NEW: Create a staging folder and compress the repository source code
116- - name : Prepare Source Code Archive
117- run : |
118- # Create a dedicated directory to hold everything going to Zenodo
119- mkdir -p zenodo-artifacts
120-
121- # Compress the repository code into that directory.
122- # We exclude the hidden .git folder and the artifacts folder itself to keep it clean.
123- echo "Compressing source code..."
124- tar -czf zenodo-artifacts/source-code.tar.gz --exclude=.git --exclude=zenodo-artifacts .
125-
126- - name : Pull and Export Docker Image
115+ - name : Prepare Final Archive and Checksum
127116 run : |
117+ # 1. Pull and save the Docker image
128118 IMAGE_ID=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
129119 VERSION=${{ github.ref_name }}
130-
131- echo "Pulling $IMAGE_ID:$VERSION..."
132120 docker pull $IMAGE_ID:$VERSION
121+ docker save $IMAGE_ID:$VERSION | gzip > docker-image.tar.gz
122+
123+ # 2. Compress the entire repository into a master .zip file.
124+ echo "Creating master zip archive..."
125+ zip -r sleec-tutorial.zip . -x "*.git*" -x "zenodo-upload/*"
126+
127+ # 3. Generate the SHA256 checksum of the new .zip file
128+ echo "Generating checksum..."
129+ sha256sum sleec-tutorial.zip > sleec-tutorial.zip.sha256
130+
131+ # Print the checksum to the standard console log
132+ echo "The SHA256 checksum is:"
133+ cat sleec-tutorial.zip.sha256
134+
135+ # Print the checksum to the GitHub Actions Job Summary page
136+ echo "### 🔐 Release Checksum" >> $GITHUB_STEP_SUMMARY
137+ echo "The SHA256 checksum for \`sleec-tutorial.zip\` is:" >> $GITHUB_STEP_SUMMARY
138+ echo "\`\`\`text" >> $GITHUB_STEP_SUMMARY
139+ cat sleec-tutorial.zip.sha256 >> $GITHUB_STEP_SUMMARY
140+ echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
133141
134- # NEW: Save the image directly into our staging folder
135- echo "Saving image to zenodo-artifacts/my-docker-image.tar.gz..."
136- docker save $IMAGE_ID:$VERSION | gzip > zenodo-artifacts/my-docker-image.tar.gz
142+ # 4. Move the final zip and checksum into a clean folder for Zenodo
143+ mkdir -p zenodo-upload
144+ mv sleec-tutorial.zip zenodo-upload/
145+ mv sleec-tutorial.zip.sha256 zenodo-upload/
137146
138147 - name : Deploy to Zenodo
139148 uses : rseng/zenodo-release@main
0 commit comments