summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-04 08:51:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-04 08:51:49 -0700
commitd49647d288de63638ffd040e35fa857909d48a61 (patch)
tree0eebdf73bf84f2ce06cd3512947e38430fd958b5
parent36748fef0d4114327ee01f3ff43524483a1e39af (diff)
downloadsubsurface-d49647d288de63638ffd040e35fa857909d48a61.tar.gz
GitHub Actions: stop creating CI releases
Net net this has caused more problems than it solved. Too often binaries were missing or broken. Instead 'release equivalent' binaries are now consistently posted to downloads/test via a Webhook. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--.github/actions/release/Dockerfile11
-rw-r--r--.github/actions/release/action.yml4
-rwxr-xr-x.github/actions/release/upload112
-rw-r--r--.github/workflows/android.yml11
-rw-r--r--.github/workflows/linux-trusty-5.12.yml10
-rw-r--r--.github/workflows/windows.yml14
6 files changed, 0 insertions, 162 deletions
diff --git a/.github/actions/release/Dockerfile b/.github/actions/release/Dockerfile
deleted file mode 100644
index af27016e1..000000000
--- a/.github/actions/release/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM alpine:latest
-
-RUN apk add --no-cache \
- bash \
- ca-certificates \
- curl \
- jq
-
-COPY upload /usr/bin/upload
-
-ENTRYPOINT ["/usr/bin/upload"]
diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml
deleted file mode 100644
index a0150197d..000000000
--- a/.github/actions/release/action.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-name: upload to release
-runs:
- using: docker
- image: Dockerfile
diff --git a/.github/actions/release/upload b/.github/actions/release/upload
deleted file mode 100755
index 758fc1bc4..000000000
--- a/.github/actions/release/upload
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/bash
-# SPDX
-
-if [[ -z "$GITHUB_TOKEN" ]]; then
- echo "missing GITHUB_TOKEN"
- exit 1
-fi
-
-if [[ -z "$GITHUB_REPO" ]] ; then
- echo "missing GITHUB_REPO"
- exit 1
-fi
-
-if [[ -z "$REF" ]] ; then
- echo "missing REF"
- exit 1
-fi
-
-if [[ -z "$COMMIT" ]] ; then
- echo "missing COMMIT"
- exit 1
-fi
-
-TAG="ci-release"
-
-echo $REF
-if [[ $REF = refs/heads/* ]] ; then
- branch="$(echo $REF | cut -d/ -f 3)"
- body="CI build of branch $branch. These binaries are for testing purposes. They are not signed and installations on Mac and Android will create warnings and errors without some extra work."
- branch="-$branch"
- echo "it's refs/heads with an added $branch"
- if [[ $REF != refs/heads/master ]] ; then
- TAG="${TAG}${branch}"
- fi
-elif [[ $REF = refs/tags/* ]] ; then
- TAG=$(echo $REF | cut -d/ -f 3)
- body="Release build ($TAG)"
-fi
-
-# check if there is a tag of that name
-# if it is starts with ci (so this is a continous integration tag) and it's on a different SHA, delete it
-tag_url="https://api.github.com/repos/$GITHUB_REPO/git/refs/tags/$TAG"
-release_url="https://api.github.com/repos/$GITHUB_REPO/releases/tags/$TAG"
-
-echo "get tag infos: curl -XGET --header \"Authorization: token xxxx\" \"${tag_url}\""
-tag_infos=$(curl -XGET --header "Authorization: token ${GITHUB_TOKEN}" "${tag_url}")
-echo "information received for tag $TAG"
-echo $tag_infos
-existing_tag_sha=$(echo $tag_infos | jq --raw-output .object.sha)
-
-need_new_release="0"
-if [[ "$existing_tag_sha" != "null" ]] ; then
- echo "existing tag on SHA $existing_tag_sha"
- existing_release=$(curl -XGET --header "Authorization: token ${GITHUB_TOKEN}" "${release_url}")
- release_id=$(echo $existing_release | jq --raw-output .id )
- echo "information received for the release with release ID \"$release_id\""
- echo $existing_release
- if [[ "$release_id" == "null" ]] ; then
- need_new_release="1"
- fi
-
- if [[ "$existing_tag_sha" != "$COMMIT" ]] ; then
- need_new_release="1"
- echo "tag was on different SHA, delete it and the corresponding release (if it exists)"
- echo "deleting tag $TAG"
- curl -XDELETE --header "Authorization: token ${GITHUB_TOKEN}" "${tag_url}"
- if [[ "$release_id" != "null" ]] ; then
- echo "Delete the release $release_id"
- delete_url="https://api.github.com/repos/$GITHUB_REPO/releases/$release_id"
- curl -XDELETE --header "Authorization: token ${GITHUB_TOKEN}" "${delete_url}"
- fi
- fi
-else
- echo "this is a new tag"
- need_new_release="1"
-fi
-
-if [[ "$need_new_release" = "1" ]] ; then
- echo "create a new release and implicitly a new tag"
- release=$(curl -H "Authorization: token ${GITHUB_TOKEN}" --data '{"tag_name": "'"$TAG"'","target_commitish": "'"$COMMIT"'","name": "'"$TAG"'","body": "'"$body"'","draft": false,"prerelease": true}' "https://api.github.com/repos/$GITHUB_REPO/releases")
- echo "response to release creation"
- echo "$release"
-fi
-
-# get the upload URL
-release_info=$(curl -XGET --header "Authorization: token ${GITHUB_TOKEN}" "${release_url}")
-echo "release info for $TAG"
-echo $release_info
-upload_url=$(echo $release_info | jq --raw-output .upload_url | cut -d '{' -f 1)
-
-if [[ "$upload_url" = "null" ]] ; then
- echo "error determining release upload URL, aborting"
- exit 1
-fi
-
-# accept up to 9 binaries via environment variables
-for FILENAME in $BIN1 $BIN2 $BIN3 $BIN4 $BIN5 $BIN6 $BIN7 $BIN8 $BIN9
-do
- if [[ -z "$FILENAME" ]] ; then
- break
- fi
- if [[ ! -f $FILENAME ]] ; then
- echo "Cannot find binary $FILENAME"
- continue
- fi
- echo "upload $FILENAME to release"
- BASENAME="$(basename $FILENAME)"
- echo "curl -H \"Authorization: token xxxxx\" -H \"Accept: application/vnd.github.manifold-preview\" -H \"Content-Type: application/octet-stream\" --data-binary @$FILENAME \"$upload_url?name=$BASENAME\""
- curl -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.manifold-preview" -H "Content-Type: application/octet-stream" --data-binary @$FILENAME "$upload_url?name=$BASENAME"
-done
-
-# vim: tw=0
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index b64f1b22f..39fd9c17b 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -28,17 +28,6 @@ jobs:
cp /__w/subsurface/subsurface-mobile-build-arm64/*mobile*/build/outputs/apk/debug/subsurface-mobile-arm64-v8a-debug.apk ${GITHUB_WORKSPACE}/Subsurface-mobile.arm64.apk
cp /__w/subsurface/subsurface-mobile-build-arm/*mobile*/build/outputs/apk/debug/subsurface-mobile-armeabi-v7a-debug.apk ${GITHUB_WORKSPACE}/Subsurface-mobile.apk
- - name: create CI release
- if: github.event_name == 'push'
- uses: ./.github/actions/release
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GITHUB_REPO: ${{ github.repository }}
- REF: ${{ github.ref }}
- COMMIT: ${{ github.sha }}
- BIN1: ./Subsurface-mobile.apk
- BIN2: ./Subsurface-mobile.arm64.apk
-
- name: prepare PR artifacts
if: github.event_name == 'pull_request'
run: |
diff --git a/.github/workflows/linux-trusty-5.12.yml b/.github/workflows/linux-trusty-5.12.yml
index f0dba517d..4e97989ec 100644
--- a/.github/workflows/linux-trusty-5.12.yml
+++ b/.github/workflows/linux-trusty-5.12.yml
@@ -23,16 +23,6 @@ jobs:
rm -rf /install-root/include/libdivecomputer
bash -x subsurface/.github/workflows/scripts/linux-in-container-build.sh
- - name: create CI release
- if: github.event_name == 'push'
- uses: ./.github/actions/release
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GITHUB_REPO: ${{ github.repository }}
- REF: ${{ github.ref }}
- COMMIT: ${{ github.sha }}
- BIN1: ./Subsurface.AppImage
-
- name: prepare PR artifacts
if: github.event_name == 'pull_request'
run: |
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index bf0a27dd2..d83b8735a 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -39,20 +39,6 @@ jobs:
bash -x subsurface/.github/workflows/scripts/windows-in-container-build.sh 2>&1 | tee build.log
grep "Built target installer" build.log
- - name: create CI release
- if: github.event_name == 'push'
- uses: ./.github/actions/release
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GITHUB_REPO: ${{ github.repository }}
- REF: ${{ github.ref }}
- COMMIT: ${{ github.sha }}
- BIN1: ./subsurface-installer.exe
- BIN2: ./subsurface.exe
- BIN3: ./subsurface.exe.debug
- BIN4: ./smtk2ssrf-installer.exe
- BIN5: ./smtk2ssrf.exe
-
- name: prepare PR artifacts
if: github.event_name == 'pull_request'
run: |