Travis: add clean edge script

pull/791/head
Koen Schmeets 2020-11-02 23:10:16 +01:00
parent 6ff8db93e8
commit 953c472897
2 changed files with 30 additions and 0 deletions

View File

@ -6,10 +6,17 @@ git:
if: tag != edge
stages:
- test
- name: clean
if: (NOT type IN (pull_request)) AND (branch = master)
- name: deploy
if: (NOT type IN (pull_request)) AND (branch = master)
jobs:
include:
- stage: clean
name: Remove Github Release
os: linux
dist: bionic
script: .travis/remove-edge.sh
- stage: test
name: macOS
os: osx

23
.travis/remove-edge.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh -xe
sudo apt-get update -qq
sudo apt-get -y install jq
old_release=$(curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/solvespace/solvespace/releases/tags/edge \
| jq -r ".url")
if [ -z "$old_release" ]; then
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
"$old_release"
fi
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/solvespace/solvespace/git/refs/tags/edge