Skip to content

Commit 7c1c70d

Browse files
JheisonMBCopilot
andcommitted
ci: fix tar command in release workflow
Use explicit tar flags (--create --gzip --file) instead of -czf to avoid parsing issues in GitHub Actions shell context. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3219bad commit 7c1c70d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Get version from Cargo.toml
3434
id: version
3535
run: |
36-
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/' | tr -d '\r')
36+
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/' | tr -d '\r' | xargs)
3737
TAG="v${VERSION}"
3838
echo "version=${VERSION}" >> $GITHUB_OUTPUT
3939
echo "tag=${TAG}" >> $GITHUB_OUTPUT
@@ -108,7 +108,7 @@ jobs:
108108
if: matrix.archive == 'tar.gz'
109109
run: |
110110
cd target/${{ matrix.target }}/release
111-
tar -czf ../../../gitkit-${{ needs.create-tag.outputs.tag }}-${{ matrix.target }}.tar.gz gitkit
111+
tar czf "../../../gitkit-${{ needs.create-tag.outputs.tag }}-${{ matrix.target }}.tar.gz" gitkit
112112
cd ../../..
113113
114114
- name: Package (windows)
@@ -199,7 +199,7 @@ jobs:
199199
- name: Check if stable release
200200
id: version_check
201201
run: |
202-
VERSION=$(grep '^version = ' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
202+
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' | xargs)
203203
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
204204
echo "is_stable=true" >> $GITHUB_OUTPUT
205205
echo "Version $VERSION is stable — will publish"

0 commit comments

Comments
 (0)