From 8991b1d8e55c5c22238520db1e45b081254ca39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=96=D1=83=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= <33721692+LeaveMyYard@users.noreply.github.com> Date: Sun, 28 May 2023 00:06:05 +0300 Subject: Fix env variables in commit to homebrew --- .github/workflows/build-on-release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build-on-release.yml b/.github/workflows/build-on-release.yml index f8f60ab..166e7b7 100644 --- a/.github/workflows/build-on-release.yml +++ b/.github/workflows/build-on-release.yml @@ -112,7 +112,8 @@ jobs: with: name: krr-macos-latest-${{ github.ref_name }} - name: Calculate hash - run: echo "MAC_BUILD_HASH=$(sha256sum krr-macos-latest-${{ github.ref_name }}.zip | awk '{print $1}')" >> $GITHUB_ENV + id: calc-hash + run: echo "::set-output name=MAC_BUILD_HASH::$(sha256sum krr-macos-latest-${{ github.ref_name }}.zip | awk '{print $1}')" # Define Linux hash job linux-hash: @@ -126,7 +127,8 @@ jobs: with: name: krr-ubuntu-latest-${{ github.ref_name }} - name: Calculate hash - run: echo "LINUX_BUILD_HASH=$(sha256sum krr-ubuntu-latest-${{ github.ref_name }}.zip | awk '{print $1}')" >> $GITHUB_ENV + id: calc-hash + run: echo "::set-output name=LINUX_BUILD_HASH::$(sha256sum krr-ubuntu-latest-${{ github.ref_name }}.zip | awk '{print $1}')" # Define job to update homebrew formula update-formula: @@ -140,9 +142,9 @@ jobs: token: ${{ secrets.MULTIREPO_GITHUB_TOKEN }} - name: Update krr.rb formula run: | - MAC_BUILD_HASH=${{ needs.mac-hash.outputs.MAC_BUILD_HASH }} - LINUX_BUILD_HASH=${{ needs.linux-hash.outputs.LINUX_BUILD_HASH }} - RELEASE_VERSION=${{ github.ref_name }} + MAC_BUILD_HASH=${{ needs.mac-hash.outputs.calc-hash.MAC_BUILD_HASH }} + LINUX_BUILD_HASH=${{ needs.linux-hash.outputs.calc-hash.LINUX_BUILD_HASH }} + TAG_NAME=${{ github.ref_name }} awk 'NR==6{$0=" url \"https://github.com/robusta-dev/krr/releases/download/'"$TAG_NAME"'/krr-macos-latest-'"$TAG_NAME"'.zip\""}1' ./Formula/krr.rb > temp && mv temp ./Formula/krr.rb awk 'NR==7{$0=" sha256 \"'$MAC_BUILD_HASH'\""}1' ./Formula/krr.rb > temp && mv temp ./Formula/krr.rb awk 'NR==9{$0=" url \"https://github.com/robusta-dev/krr/releases/download/'"$TAG_NAME"'/krr-linux-latest-'"$TAG_NAME"'.zip\""}1' ./Formula/krr.rb > temp && mv temp ./Formula/krr.rb @@ -151,5 +153,5 @@ jobs: run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git commit -am "Update formula for release ${RELEASE_VERSION}" + git commit -am "Update formula for release ${TAG_NAME}" git push -- cgit v1.2.3