Update sync_warp-go.yml

dependabot/github_actions/goreleaser/goreleaser-action-4
fscarmen 3 years ago committed by GitHub
parent 9f58d5e9d1
commit bb4b65e014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      .github/workflows/sync_warp-go.yml

@ -27,16 +27,8 @@ jobs:
run: |
NOW=$(wget -qO- "https://api.github.com/repos/${{ env.USERNAME }}/warp/releases" | grep "tag_name" | grep -i "wireguard-go" | head -n 1 | sed "s/.*_v\(.*\)\".*/\1/g")
LATEST=$(wget -qO- https://git.zx2c4.com/wireguard-go/ | grep '/wireguard-go/tag' | sed -n 1p | sed "s/.*>\([0-9.]\{1,\}\)<.*/\1/g")
NOW1=$(echo $NOW | cut -d \. -f1)
NOW2=$(echo $NOW | cut -d \. -f2)
NOW3=$(echo $NOW | cut -d \. -f3)
LATEST1=$(echo $LATEST | cut -d \. -f1)
LATEST2=$(echo $LATEST | cut -d \. -f2)
LATEST3=$(echo $LATEST | cut -d \. -f3)
NOW_VERSION=$(( NOW1*1000000 + NOW2*1000 + NOW3 ))
LATEST_VERSION=$(( LATEST1*1000000 + LATEST2*1000 + LATEST3 ))
if [ $LATEST_VERSION -gt $NOW_VERSION ]; then
if [ "$LATEST_VERSION" != "$NOW_VERSION" ]; then
git clone https://git.zx2c4.com/wireguard-go ${{ env.WORKDIR }}
cp ./.github/wireguard-go-releaser.yml ${{ env.WORKDIR }}/.goreleaser.yml
echo "VERSION=$LATEST" >> $GITHUB_ENV
@ -57,7 +49,7 @@ jobs:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Release binaries
uses: softprops/action-gh-release@v1

Loading…
Cancel
Save