@@ -75,44 +75,34 @@ jobs:
75
75
- name : Prepare package
76
76
shell : bash
77
77
run : |
78
- # Define the final package name from the matrix
79
78
PACKAGE_NAME="lstr-${{ matrix.asset_name_suffix }}"
79
+ STAGING_DIR="staging"
80
+
81
+ mkdir "$STAGING_DIR"
80
82
81
- # Create a temporary staging directory to hold the assets
82
- mkdir staging
83
-
84
- # Copy the correct binary into the staging directory
85
83
if [[ "${{ runner.os }}" == "Windows" ]]; then
86
- cp target/${{ matrix.target }}/release/lstr.exe staging/
84
+ cp " target/${{ matrix.target }}/release/lstr.exe" "$STAGING_DIR/"
87
85
else
88
- cp target/${{ matrix.target }}/release/lstr staging/
86
+ cp " target/${{ matrix.target }}/release/lstr" "$STAGING_DIR/"
89
87
fi
90
88
91
- # Copy documentation into the staging directory
92
- cp README.md staging/
93
- cp LICENSE staging/
94
-
95
- # --- Start of Debugging ---
89
+ cp README.md "$STAGING_DIR/"
90
+ cp LICENSE "$STAGING_DIR/"
91
+
96
92
echo "--- Contents of staging directory ---"
97
- ls -R staging
98
- # --- End of Debugging ---
93
+ ls -R "$STAGING_DIR"
99
94
100
- # Create the final archive from the contents of the staging directory
101
95
if [[ "${{ runner.os }}" == "Windows" ]]; then
102
- # For zip, archive the files inside the staging directory
103
- 7z a "$PACKAGE_NAME" ./staging/*
96
+ 7z a "$PACKAGE_NAME" "./$STAGING_DIR/*"
104
97
else
105
- # For tar.gz, change directory to staging and archive its contents
106
- tar -czf "../ $PACKAGE_NAME" .
98
+ # Corrected tar command: Create archive in the current directory
99
+ tar -czf "$PACKAGE_NAME" -C "$STAGING_DIR " .
107
100
fi
108
101
109
- # --- Start of Debugging ---
110
102
echo "--- Contents of workspace after archiving ---"
111
- ls -R
103
+ ls -R .
112
104
echo "ASSET will be set to: $PACKAGE_NAME"
113
- # --- End of Debugging ---
114
-
115
- # Set the asset name for the next step
105
+
116
106
echo "ASSET=$PACKAGE_NAME" >> $GITHUB_ENV
117
107
118
108
- name : Upload Release Asset
0 commit comments