From 6656ca97e090728dcf62929072e506bd2aa0577f Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Sun, 19 Nov 2023 20:07:53 +0000 Subject: [PATCH] Automatically upload assets to GitHub Releases --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adf4b63..15af43e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -200,6 +200,37 @@ publish-github: - node_modules/ policy: pull +publish-github-releases: + stage: deploy + image: alpine + before_script: + - apk add github-cli + script: + - gh release --repo "$GITHUB_REPOSITORY" view "$CI_COMMIT_TAG" --json id,url || gh release --repo "$GITHUB_REPOSITORY" create "$CI_COMMIT_TAG" --verify-tag --draft --generate-notes + + - | + gh release --repo "$GITHUB_REPOSITORY" upload "$CI_COMMIT_TAG" \ + "app/Nintendo\ Switch\ Online-*-mac.zip" \ + "app/Nintendo\ Switch\ Online-*.AppImage" \ + "app/nxapi-app_*.deb" \ + "app/nxapi-app_*.snap" \ + "app/Nintendo\ Switch\ Online\ Setup\ *.exe" + needs: + - build-app + - build-windows + only: + refs: + - /^v.*$/ + variables: + - $GITHUB_REPOSITORY + - $GITHUB_TOKEN + except: + - branches + cache: + paths: + - node_modules/ + policy: pull + publish-next: stage: deploy script: