From: Jérémie Astor Date: Mon, 21 Sep 2020 23:00:22 +0000 (+0200) Subject: Use released Gwion X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=b838963b3cbeab74c7160d9cdcb07847ded4087d;p=gwion.git Use released Gwion --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62a6e1c1..dcc78576 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,28 +37,8 @@ jobs: git checkout master make - - uses: actions/cache@v1 - name: Gwion [ cache ] - id: gwion-bin - with: - path: Gwion - key: ${{ runner.os }}-gwion - - name: Gwion - if: steps.gwion-bin.outputs.cache-hit != 'true' - uses: fennecdjay/gwion-action@v1 - - - name: Gwion [ update ] - if: steps.gwion-bin.outputs.cache-hit == 'true' - run: | - cd Gwion - if [ $(git rev-parse HEAD) != $(git ls-remote https://github.com/fennecdjay/Gwion.git HEAD | cut -f1) ] - then - git pull - git submodule update util ast - make - fi - cp gwion .. + run: bash scripts/update.sh - uses: fennecdjay/emojify-docker-action@v2 name: Emojify diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100644 index 00000000..f80accac --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +get_latest_release() { + curl --silent "https://api.github.com/repos/$1/$2/releases/latest" | # Get latest release from GitHub api + grep '"tag_name":' | # Get tag line + sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value +} + +update() { + new_release=$(get_latest_release $1 $2) + url=https://github.com/$1/$2/releases/download + file=linux.tar.gz + wget "$url/$new_release/$file" + tar -zxvf $file + rm $file +} + +update fennecdjay Gwion