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
--- /dev/null
+#!/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