From 5ca392392e9faafabf03ae39016c69199fd2150b Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Thu, 22 Feb 2024 15:22:03 +0400 Subject: [PATCH] add release tarball --- .github/workflows/release.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42417e90..ffc75680 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,11 +106,32 @@ jobs: echo "PKG_WHEPFROM_NAME=whepfrom-${PKG_BUILDNAME}" >> $GITHUB_ENV echo "PKG_WHIPINTO_NAME=whipinto-${PKG_BUILDNAME}" >> $GITHUB_ENV + - name: Create tarball + shell: bash + run: | + TAR_SUFFIX=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) TAR_SUFFIX=".zip" ;; esac; + TAR_BASENAME=live777-${{ env.VERSION }}-${{ matrix.job.target }} + TAR_NAME=${TAR_BASENAME}${TAR_SUFFIX} + ARCHIVE_DIR="${TAR_BASENAME}/" + + mkdir -p "${ARCHIVE_DIR}" + cp "${{ env.BUILD_PATH }}/live777${{ env.EXE_SUFFIX }}" "$ARCHIVE_DIR" + cp "README.md" "LICENSE" "config-dist.toml" "live777.service" "$ARCHIVE_DIR" + + # base compressed package + case ${{ matrix.job.target }} in + *-pc-windows-*) 7z -y a "${TAR_NAME}" "${TAR_BASENAME}"/* | tail -2 ;; + *) tar czf "${TAR_NAME}" "${TAR_BASENAME}"/* ;; + esac; + + # Let subsequent steps know where to find the compressed package + echo "TAR_LIVE777_NAME=${TAR_NAME}" >> $GITHUB_ENV + - name: Artifact Upload uses: actions/upload-artifact@v3 with: name: ${{ env.PKG_LIVE777_NAME }} - path: ${{ env.BUILD_PATH }}/live777${{ env.EXE_SUFFIX }} + path: ${TAR_NAME} - name: Artifact Upload Whepfrom uses: actions/upload-artifact@v3