Skip to content

Commit e565ea9

Browse files
committed
ci: the vibes are off
1 parent 43e999e commit e565ea9

File tree

2 files changed

+22
-32
lines changed

2 files changed

+22
-32
lines changed

.github/workflows/package-release.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,21 @@ jobs:
3838
- name: Create package
3939
id: create_package
4040
run: |
41-
# Create the package and capture only the filename
42-
FILENAME=$(.github/workflows/scripts/create-package.sh "${{ steps.version.outputs.version }}" "${{ steps.current_time.outputs.timestamp }}")
41+
# Run the script and capture the output (which should be just the filename)
42+
OUTPUT_FILE=$(.github/workflows/scripts/create-package.sh "${{ steps.version.outputs.version }}" "${{ steps.current_time.outputs.timestamp }}")
4343
44-
# Debug output
45-
echo "Package script returned: '$FILENAME'"
44+
# Trim any whitespace
45+
OUTPUT_FILE=$(echo "$OUTPUT_FILE" | xargs)
4646
47-
# Validate that the file exists
48-
if [ -f "$FILENAME" ]; then
49-
echo "Found package file: $FILENAME"
50-
echo "package_path=$FILENAME" >> $GITHUB_OUTPUT
47+
echo "Generated package file: $OUTPUT_FILE"
48+
49+
# Verify the file exists
50+
if [ -f "$OUTPUT_FILE" ]; then
51+
echo "File exists and is readable"
52+
ls -la "$OUTPUT_FILE"
53+
echo "package_path=$OUTPUT_FILE" >> $GITHUB_OUTPUT
5154
else
52-
echo "ERROR: Package file not found: $FILENAME"
53-
exit 1
54-
fi
55-
56-
- name: Debug outputs
57-
run: |
58-
echo "Version: ${{ steps.version.outputs.version }}"
59-
echo "Package path: ${{ steps.create_package.outputs.package_path }}"
60-
ls -la
61-
62-
- name: Create Release
63-
id: create_release
64-
uses: softprops/action-gh-release@v1
65-
# Run this step in all cases where we have a package
66-
if: steps.create_package.outputs.package_path != ''
67-
with:
68-
files: ${{ steps.create_package.outputs.package_path }}
69-
name: Rider-Waite-Smith Tarot Deck v${{ steps.version.outputs.version }}
55+
echo "ERROR
7056
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('v{0}', steps.version.outputs.version) }}
7157
draft: false
7258
prerelease: false

.github/workflows/scripts/create-package.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -euo pipefail
2+
set -e
33

44
# Get the version from the first parameter
55
VERSION=$1
@@ -15,7 +15,8 @@ fi
1515
PACKAGE_NAME="rider-waite-smith-${VERSION}"
1616
ZIP_FILE="${PACKAGE_NAME}.zip"
1717

18-
echo "Creating package: ${ZIP_FILE}..."
18+
# Status messages go to stderr
19+
echo "Creating package: ${ZIP_FILE}..." >&2
1920

2021
# Create a temporary directory for packaging
2122
TEMP_DIR=$(mktemp -d)
@@ -36,14 +37,17 @@ Repository: ${GITHUB_REPOSITORY:-"arcanaland/specifications"}
3637
This package follows the Tarot Deck Specification v1.0.
3738
EOL
3839

39-
# Create the zip file and redirect output to stderr so it doesn't affect the function output
40-
(cd "${TEMP_DIR}" && zip -r "${ZIP_FILE}" "${PACKAGE_NAME}" 1>&2)
40+
# Create the zip file and redirect output to stderr
41+
(cd "${TEMP_DIR}" && zip -r "${ZIP_FILE}" "${PACKAGE_NAME}" >&2)
4142

4243
# Move the zip file to the current directory
4344
mv "${TEMP_DIR}/${ZIP_FILE}" .
4445

4546
# Clean up the temporary directory
4647
rm -rf "${TEMP_DIR}"
4748

48-
echo "Package created: ${ZIP_FILE}" >&2
49-
printf "%s" "${ZIP_FILE}" # Print the filename without newline
49+
# Inform about success on stderr
50+
echo "Package created successfully: ${ZIP_FILE}" >&2
51+
52+
# ONLY output the filename to stdout - nothing else!
53+
echo "${ZIP_FILE}"

0 commit comments

Comments
 (0)