From 414da907f8497049f0f0a032d190db3698aed870 Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Fri, 15 Dec 2023 08:30:20 -0800 Subject: [PATCH] Use release in gen mani action --- .../workflows/generate-manifests-demos.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/generate-manifests-demos.yaml b/.github/workflows/generate-manifests-demos.yaml index e01a26c..f8f0064 100644 --- a/.github/workflows/generate-manifests-demos.yaml +++ b/.github/workflows/generate-manifests-demos.yaml @@ -1,6 +1,10 @@ name: Generate manifests for demo on: [push] +env: + USE_RELEASE: true + RELEASE_TAG: v0.1.0 + jobs: build-and-run: runs-on: ubuntu-latest @@ -13,7 +17,25 @@ jobs: git config --global user.name 'Bot' git config --global user.email 'bot@users.noreply.github.com' + - name: Download mani-diffy binary + if: env.USE_RELEASE == 'true' + uses: actions/github-script@v5 + with: + script: | + const { owner, repo } = context.repo + const release = await github.rest.repos.getReleaseByTag({ + owner, + repo, + tag: core.getInput('release_tag') + }) + const asset = release.data.assets.find(asset => asset.name === 'mani-diffy') + const downloadUrl = asset.browser_download_url + await exec.exec('wget', ['-O', 'mani-diffy', downloadUrl]) + await exec.exec('chmod', ['+x', 'mani-diffy']) + release_tag: ${{ env.RELEASE_TAG }} + - name: Compile + if: env.USE_RELEASE == 'false' run: | make build-binaries