From 1b4ffdbb044f524624b3467bded0555113c7fa07 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 27 May 2021 23:23:46 -0700 Subject: [PATCH] Distribute release binary in an archive The release workflow builds the tool and uploads the binary as a release asset. That asset is used by the indexer job and also may be convenient to those who would like to test the release without setting up a build system locally. Previously, the binary was uploaded directly to the release. This caused the executable permissions to be lost, causing inconvenience and potential confusion for the consumers. This can be avoided by packaging the binary in an archive. As an added benefit, the download size is decreased. --- .github/workflows/release.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4f1164a..bdc031bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ jobs: - name: Set environment variables run: | # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "ARCHIVE_PATH=${{ runner.temp }}/libraries-repository-engine_Linux_64bit.tar.gz" >> "$GITHUB_ENV" echo "CHANGELOG_PATH=${{ runner.temp }}/CHANGELOG.md" >> "$GITHUB_ENV" - name: Checkout repository @@ -34,6 +35,15 @@ jobs: - name: Build project run: task build + - name: Archive release binary + run: | + tar \ + --create \ + --add-file="./libraries-repository-engine" \ + --add-file="./LICENSE.txt" \ + --gzip \ + --file="${{ env.ARCHIVE_PATH }}" + - name: Create changelog uses: arduino/create-changelog@v1 with: @@ -63,4 +73,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} bodyFile: ${{ env.CHANGELOG_PATH }} prerelease: ${{ steps.prerelease.outputs.is-pre }} - artifacts: libraries-repository-engine + artifacts: ${{ env.ARCHIVE_PATH }}