From 4a7e57dd88e5ac06fc3373e9ff7b6469559b6123 Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sat, 12 Oct 2024 00:46:09 +0100 Subject: [PATCH] ci(rssgen): :bug: fix an item with the specified name D:\a\rssgen\rssgen\target\package already exists. --- .github/workflows/release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a7e737..ec37e2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,9 +54,23 @@ jobs: run: cargo build --verbose --release --target ${{ matrix.target }} - name: Package run: | - mkdir -p target/package + if [ ! -d "target/package" ]; then + mkdir -p target/package + fi cd target/${{ matrix.target }}/release tar czf ../../package/${{ matrix.target }}.tar.gz * + shell: bash + + - name: Package (Windows) + if: matrix.os == 'windows-latest' + run: | + if (!(Test-Path "target/package")) { + mkdir target/package + } + cd target/${{ matrix.target }}/release + tar -czf ../../package/${{ matrix.target }}.tar.gz * + shell: pwsh + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} @@ -70,7 +84,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set version - run: echo "VERSION=$(grep version Cargo.toml | sed -n 2p | cut -d '"' -f 2)" >> $GITHUB_ENV + run: echo "VERSION=$(grep -m 1 '^version =' Cargo.toml | cut -d '"' -f 2)" >> $GITHUB_ENV - uses: actions/download-artifact@v4 with: path: artifacts