From b219d6a6b6c2f1a28c96daf418a3418d2da17959 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 20 Feb 2023 17:17:37 -0500 Subject: [PATCH 01/17] Create github release from tags and upload artifacts as assets --- .ci/update-github-release.sh | 56 ++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 21 ++++++++++++-- appveyor.yml | 3 -- 3 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 .ci/update-github-release.sh diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh new file mode 100644 index 00000000..49f5e18a --- /dev/null +++ b/.ci/update-github-release.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +if [ -z "$CI_COMMIT_TAG" ]; then + echo "CI_COMMIT_TAG is unset or empty; exiting" + exit 1 +fi + + +# check if we already have a release for the current tag or not +http_code=$(curl \ + -s \ + -o /dev/null \ + -I \ + -w "%{http_code}" \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${GITHUB_AUTH_TOKEN}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") + +if [ "$http_code" = "404" ]; then + # Doing a 'fresh' release, not just updating the assets. + release_json="$(curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${GITHUB_AUTH_TOKEN}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/Nheko-Reborn/nheko/releases \ + -d "{\"tag_name\":\"${CI_COMMIT_TAG}\",\"target_commitish\":\"master\",\"name\":\"${CI_COMMIT_TAG}\",\"body\":\"Description of the release\",\"draft\":true,\"prerelease\":true,\"generate_release_notes\":false}")" +elif [ "$http_code" = "200" ]; then + # Updating a release (probably because of cirrus-ci or so) + release_json=$(curl \ + -s \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${GITHUB_AUTH_TOKEN}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") +fi + +upload_url="$(echo "$release_json" | jq ".upload-url")" +# get rid of the 'hypermedia' stuff at the end and use a 'real' URL +upload_url="$(echo "$upload_url" | sed 's/{?name,label\}/?name/g')" + +for file in ./artifacts/*; do + name="${file##*/}" + [ -e "$file" ] && curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${GITHUB_AUTH_TOKEN}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + -H "Content-Type: application/octet-stream" \ + "${upload_url}=$name" \ + --data-binary "@$name" +done + + +# TODO: AppVeyor stuffs? \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58524d03..fe1cf1fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,8 @@ +stages: + - build + - sign + - deploy + variables: CCACHE_COMPILERCHECK: content CCACHE_DIR: "${CI_PROJECT_DIR}/.ccache" @@ -136,7 +141,7 @@ build-macos: - "${CCACHE_DIR}" codesign-macos: - stage: deploy + stage: sign tags: [macos] variables: PLAT: "intel" @@ -153,12 +158,12 @@ codesign-macos: rules: - if : '$CI_PIPELINE_TRIGGERED && $CI_COMMIT_REF_PROTECTED == "true"' variables: - PLAT: "m1" + PLAT: "apple_silicon" - if : '$CI_COMMIT_BRANCH == "master"' - if : $CI_COMMIT_TAG artifacts: paths: - - artifacts/nheko-${CI_COMMIT_SHORT_SHA}_${PLAT}.dmg + - artifacts/nheko-${CI_COMMIT_SHORT_SHA}-${PLAT}.dmg - /tmp/notarize* name: nheko-${CI_COMMIT_SHORT_SHA}-macos @@ -303,3 +308,13 @@ linting: rules: - if : '$CI_PIPELINE_TRIGGERED == null' +github-release: + stage: deploy + image: alpine:latest + tags: [docker] + rules: + - if: '$CI_COMMIT_TAG != null' + before_script: + - apk update && apk add jq + script: + - ./.ci/update-github-release.sh \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index ad849ca1..76932ac2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -109,9 +109,6 @@ after_build: - copy nheko-installer.exe nheko-%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%-installer.exe - ps: .\.ci\upload-nightly.ps1 -on_success: - - if "%APPVEYOR_REPO_TAG%" == "true" (curl -T nheko-%APPVEYOR_REPO_TAG_NAME%-installer.exe -uredsky17:%BINTRAY_APIKEY% https://api.bintray.com/content/nheko-reborn/nheko/%APPVEYOR_REPO_TAG_NAME%/nheko/%APPVEYOR_REPO_TAG_NAME%/) - deploy: - description: "Development builds" provider: GitHub From 62dd85ab677cd1374f97b39dcc4d09a7d3bf4ff0 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 20 Feb 2023 19:03:57 -0500 Subject: [PATCH 02/17] Use regex to match vX.Y.Z --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe1cf1fc..9ee6744d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -313,7 +313,7 @@ github-release: image: alpine:latest tags: [docker] rules: - - if: '$CI_COMMIT_TAG != null' + - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' before_script: - apk update && apk add jq script: From f3966bd1ce8b3417d4091a4f87e71078ced52007 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 20 Feb 2023 19:16:43 -0500 Subject: [PATCH 03/17] Generate release notes from CHANGELOG.md --- .ci/update-github-release.sh | 3 ++- .gitlab-ci.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh index 49f5e18a..488063ca 100644 --- a/.ci/update-github-release.sh +++ b/.ci/update-github-release.sh @@ -18,6 +18,7 @@ http_code=$(curl \ "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") if [ "$http_code" = "404" ]; then + release_notes="$(perl -0777 -ne '/.*?(## .*?)\n(## |\Z)/s && print $1' CHANGELOG.md | jq -R -s '.')" # Doing a 'fresh' release, not just updating the assets. release_json="$(curl \ -X POST \ @@ -25,7 +26,7 @@ if [ "$http_code" = "404" ]; then -H "Authorization: Bearer ${GITHUB_AUTH_TOKEN}"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/Nheko-Reborn/nheko/releases \ - -d "{\"tag_name\":\"${CI_COMMIT_TAG}\",\"target_commitish\":\"master\",\"name\":\"${CI_COMMIT_TAG}\",\"body\":\"Description of the release\",\"draft\":true,\"prerelease\":true,\"generate_release_notes\":false}")" + -d "{\"tag_name\":\"${CI_COMMIT_TAG}\",\"target_commitish\":\"master\",\"name\":\"${CI_COMMIT_TAG}\",\"body\":\"${release_notes}\",\"draft\":true,\"prerelease\":true,\"generate_release_notes\":false}")" elif [ "$http_code" = "200" ]; then # Updating a release (probably because of cirrus-ci or so) release_json=$(curl \ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ee6744d..c4df66e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -317,4 +317,4 @@ github-release: before_script: - apk update && apk add jq script: - - ./.ci/update-github-release.sh \ No newline at end of file + - ./.ci/update-github-release.sh From b4cfb630294c80cea3c9f24e415f7d16dff18c71 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Feb 2023 15:09:07 -0500 Subject: [PATCH 04/17] Test pattern for validation of functionality --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4df66e9..f08c8ef1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -313,7 +313,7 @@ github-release: image: alpine:latest tags: [docker] rules: - - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' + - if: '$CI_COMMIT_TAG =~ /^test\d+\.\d+\.\d+$/' before_script: - apk update && apk add jq script: From 9a0320dd504f4593577820e108388bb51abdbf0d Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Feb 2023 16:21:39 -0500 Subject: [PATCH 05/17] Make github script executable --- .ci/update-github-release.sh | 0 .gitlab-ci.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 .ci/update-github-release.sh diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh old mode 100644 new mode 100755 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f08c8ef1..c6079f52 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -218,7 +218,7 @@ build-flatpak-arm64: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true rules: - - if : '$CI_PIPELINE_TRIGGERED == null' + - if : '$CI_PIPELINE_TRIGGERED == 123456' cache: key: "$CI_JOB_NAME" paths: From 8691e029b5256b3e13a18aa4e2f230dd2f064ce3 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Feb 2023 16:25:47 -0500 Subject: [PATCH 06/17] Fix ci rule --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6079f52..a101cfcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -218,7 +218,7 @@ build-flatpak-arm64: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true rules: - - if : '$CI_PIPELINE_TRIGGERED == 123456' + - if : '$CI_PIPELINE_TRIGGERED == "123456"' cache: key: "$CI_JOB_NAME" paths: From 86083d644da49d740796183534235b67b7237563 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Feb 2023 16:55:48 -0500 Subject: [PATCH 07/17] Install curl from apk --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a101cfcf..9082fc8d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -315,6 +315,6 @@ github-release: rules: - if: '$CI_COMMIT_TAG =~ /^test\d+\.\d+\.\d+$/' before_script: - - apk update && apk add jq + - apk update && apk add jq curl script: - ./.ci/update-github-release.sh From caa1c4c565636adbaac7f4f4ad34a635d8effb6b Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Feb 2023 17:34:31 -0500 Subject: [PATCH 08/17] Add perl --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9082fc8d..fd62ce16 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -315,6 +315,6 @@ github-release: rules: - if: '$CI_COMMIT_TAG =~ /^test\d+\.\d+\.\d+$/' before_script: - - apk update && apk add jq curl + - apk update && apk add jq curl perl script: - ./.ci/update-github-release.sh From b4148d9ca5d09d9e9aa34b1cbe2f6d9257b527dd Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Feb 2023 18:02:31 -0500 Subject: [PATCH 09/17] Maybe fix key naming issue --- .ci/update-github-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh index 488063ca..aed99ad1 100755 --- a/.ci/update-github-release.sh +++ b/.ci/update-github-release.sh @@ -37,7 +37,7 @@ elif [ "$http_code" = "200" ]; then "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") fi -upload_url="$(echo "$release_json" | jq ".upload-url")" +upload_url="$(echo "$release_json" | jq '."upload-url"')" # get rid of the 'hypermedia' stuff at the end and use a 'real' URL upload_url="$(echo "$upload_url" | sed 's/{?name,label\}/?name/g')" From 4fc14b62cf8f228c3baf6e138e4e31175d24451f Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 10:59:47 -0500 Subject: [PATCH 10/17] Add more logging to CI script --- .ci/update-github-release.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh index aed99ad1..ca7aab50 100755 --- a/.ci/update-github-release.sh +++ b/.ci/update-github-release.sh @@ -5,7 +5,7 @@ if [ -z "$CI_COMMIT_TAG" ]; then exit 1 fi - +echo "Checking if release exists for ${CI_COMMIT_TAG}" # check if we already have a release for the current tag or not http_code=$(curl \ -s \ @@ -18,7 +18,10 @@ http_code=$(curl \ "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") if [ "$http_code" = "404" ]; then + echo "Release does not exist... getting notes from CHANGELOG.md" release_notes="$(perl -0777 -ne '/.*?(## .*?)\n(## |\Z)/s && print $1' CHANGELOG.md | jq -R -s '.')" + + echo "Creating new release for ${CI_COMMIT_TAG}" # Doing a 'fresh' release, not just updating the assets. release_json="$(curl \ -X POST \ @@ -28,6 +31,7 @@ if [ "$http_code" = "404" ]; then https://api.github.com/repos/Nheko-Reborn/nheko/releases \ -d "{\"tag_name\":\"${CI_COMMIT_TAG}\",\"target_commitish\":\"master\",\"name\":\"${CI_COMMIT_TAG}\",\"body\":\"${release_notes}\",\"draft\":true,\"prerelease\":true,\"generate_release_notes\":false}")" elif [ "$http_code" = "200" ]; then + echo "Release already exists for ${CI_COMMIT_TAG}; Updating" # Updating a release (probably because of cirrus-ci or so) release_json=$(curl \ -s \ @@ -37,12 +41,16 @@ elif [ "$http_code" = "200" ]; then "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") fi +echo "Getting upload URL..." upload_url="$(echo "$release_json" | jq '."upload-url"')" # get rid of the 'hypermedia' stuff at the end and use a 'real' URL +echo "Upload URL (hypermedia): ${upload_url}" upload_url="$(echo "$upload_url" | sed 's/{?name,label\}/?name/g')" +echo "Uploading artifacts" for file in ./artifacts/*; do name="${file##*/}" + echo "Uploading ${name}" [ -e "$file" ] && curl \ -X POST \ -H "Accept: application/vnd.github+json" \ @@ -50,7 +58,7 @@ for file in ./artifacts/*; do -H "X-GitHub-Api-Version: 2022-11-28" \ -H "Content-Type: application/octet-stream" \ "${upload_url}=$name" \ - --data-binary "@$name" + --data-binary "@$file" done From 701058ef211ef457ef49149fea0a054883f621a4 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 12:04:55 -0500 Subject: [PATCH 11/17] Release notes are already quoted --- .ci/update-github-release.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh index ca7aab50..d51b4dd9 100755 --- a/.ci/update-github-release.sh +++ b/.ci/update-github-release.sh @@ -18,8 +18,9 @@ http_code=$(curl \ "https://api.github.com/repos/Nheko-Reborn/nheko/releases/tags/$CI_COMMIT_TAG") if [ "$http_code" = "404" ]; then - echo "Release does not exist... getting notes from CHANGELOG.md" + echo "Release does not exist... getting notes from CHANGELOG.md:" release_notes="$(perl -0777 -ne '/.*?(## .*?)\n(## |\Z)/s && print $1' CHANGELOG.md | jq -R -s '.')" + echo "$release_notes" echo "Creating new release for ${CI_COMMIT_TAG}" # Doing a 'fresh' release, not just updating the assets. @@ -29,7 +30,7 @@ if [ "$http_code" = "404" ]; then -H "Authorization: Bearer ${GITHUB_AUTH_TOKEN}"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/Nheko-Reborn/nheko/releases \ - -d "{\"tag_name\":\"${CI_COMMIT_TAG}\",\"target_commitish\":\"master\",\"name\":\"${CI_COMMIT_TAG}\",\"body\":\"${release_notes}\",\"draft\":true,\"prerelease\":true,\"generate_release_notes\":false}")" + -d "{\"tag_name\":\"${CI_COMMIT_TAG}\",\"target_commitish\":\"master\",\"name\":\"${CI_COMMIT_TAG}\",\"body\":${release_notes},\"draft\":true,\"prerelease\":true,\"generate_release_notes\":false}")" elif [ "$http_code" = "200" ]; then echo "Release already exists for ${CI_COMMIT_TAG}; Updating" # Updating a release (probably because of cirrus-ci or so) From 51c9245c6a283e0ee3a091888dd647d1c929de78 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 12:53:27 -0500 Subject: [PATCH 12/17] Fix upload_url json key --- .ci/update-github-release.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh index d51b4dd9..ac643987 100755 --- a/.ci/update-github-release.sh +++ b/.ci/update-github-release.sh @@ -43,15 +43,16 @@ elif [ "$http_code" = "200" ]; then fi echo "Getting upload URL..." -upload_url="$(echo "$release_json" | jq '."upload-url"')" +upload_url="$(echo "$release_json" | jq '."upload_url"')" # get rid of the 'hypermedia' stuff at the end and use a 'real' URL echo "Upload URL (hypermedia): ${upload_url}" upload_url="$(echo "$upload_url" | sed 's/{?name,label\}/?name/g')" +ls -la . echo "Uploading artifacts" for file in ./artifacts/*; do name="${file##*/}" - echo "Uploading ${name}" + echo "Uploading $file" [ -e "$file" ] && curl \ -X POST \ -H "Accept: application/vnd.github+json" \ From 9a1a065c61f1d24700e208a299f787d8270c0788 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 13:39:11 -0500 Subject: [PATCH 13/17] Put releasable artifacts into artifacts dir --- .ci/macos/notarize.sh | 2 +- .gitlab-ci.yml | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.ci/macos/notarize.sh b/.ci/macos/notarize.sh index 2757d44c..cb3d3ef7 100755 --- a/.ci/macos/notarize.sh +++ b/.ci/macos/notarize.sh @@ -98,6 +98,6 @@ VERSION=${CI_COMMIT_SHORT_SHA} if [ -n "$VERSION" ]; then mv nheko.dmg "nheko-${VERSION}_${PLAT}.dmg" - mkdir artifacts + mkdir -p artifacts cp "nheko-${VERSION}_${PLAT}.dmg" artifacts/ fi \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd62ce16..690cab7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -130,7 +130,7 @@ build-macos: - if : '$CI_PIPELINE_TRIGGERED == null' artifacts: paths: - - build/nheko.app + - build/nheko.app # not putting this in 'artifacts' subdir because we don't want to put it on releases name: nheko-${CI_COMMIT_SHORT_SHA}-macos-app expose_as: 'macos-app' public: false @@ -186,6 +186,7 @@ build-flatpak-amd64: after_script: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-amd64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true + - (cd $CI_BUILDS_DIR && mkdir -p artifacts && cp build-flatpak/nheko-arm64.flatpak artifacts/) || true rules: - if : '$CI_PIPELINE_TRIGGERED == null' cache: @@ -194,7 +195,7 @@ build-flatpak-amd64: - build-flatpak/.flatpak-builder/ artifacts: expose_as: 'flatpak-amd64' - paths: ['build-flatpak/nheko-amd64.flatpak'] + paths: ['artifacts/nheko-amd64.flatpak'] name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-amd64 build-flatpak-arm64: @@ -217,6 +218,7 @@ build-flatpak-arm64: after_script: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true + - (cd $CI_BUILDS_DIR && mkdir -p artifacts && cp build-flatpak/nheko-arm64.flatpak artifacts/) || true rules: - if : '$CI_PIPELINE_TRIGGERED == "123456"' cache: @@ -225,7 +227,7 @@ build-flatpak-arm64: - build-flatpak/.flatpak-builder/ artifacts: expose_as: 'flatpak-arm64' - paths: ['build-flatpak/nheko-arm64.flatpak'] + paths: ['artifacts/nheko-arm64.flatpak'] name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-arm64 appimage-amd64: @@ -279,12 +281,13 @@ appimage-amd64: - mkdir -p AppDir/usr/lib/x86_64-linux-gnu AppDir/lib/x86_64-linux-gnu - appimage-builder --skip-test after_script: + - mkdir -p artifacts && cp nheko-latest-x86_64.AppImage artifacts/ - bash ./.ci/upload-nightly-gitlab.sh nheko-latest-x86_64.AppImage rules: - if : '$CI_PIPELINE_TRIGGERED == null' artifacts: paths: - - 'nheko-latest-x86_64.AppImage' + - 'artifacts/nheko-latest-x86_64.AppImage' expire_in: 1 week expose_as: 'appimage-amd64' cache: @@ -314,6 +317,9 @@ github-release: tags: [docker] rules: - if: '$CI_COMMIT_TAG =~ /^test\d+\.\d+\.\d+$/' + dependencies: + - build + - sign before_script: - apk update && apk add jq curl perl script: From 3737da0b67b1d2ec64c5ea5a88808d9d0421351f Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 13:48:21 -0500 Subject: [PATCH 14/17] Fix dependencies --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 690cab7f..1e6e1791 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -318,8 +318,10 @@ github-release: rules: - if: '$CI_COMMIT_TAG =~ /^test\d+\.\d+\.\d+$/' dependencies: - - build - - sign + - appimage-amd64 + - build-flatpak-arm64 + - build-flatpak-amd64 + - codesign-macos before_script: - apk update && apk add jq curl perl script: From 40ab6f5ce948d41e883e52a266081c62258e8a88 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 14:10:55 -0500 Subject: [PATCH 15/17] Fix typo in flatpak name for amd64 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e6e1791..92e11338 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -186,7 +186,7 @@ build-flatpak-amd64: after_script: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-amd64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true - - (cd $CI_BUILDS_DIR && mkdir -p artifacts && cp build-flatpak/nheko-arm64.flatpak artifacts/) || true + - (cd $CI_BUILDS_DIR && mkdir -p artifacts && cp build-flatpak/nheko-amd64.flatpak artifacts/) || true rules: - if : '$CI_PIPELINE_TRIGGERED == null' cache: From 7a8bfe49400c18eb288952a7b834c057fa652c3b Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 16:16:24 -0500 Subject: [PATCH 16/17] Fix macOS artifact names and fix jq quotes issue --- .ci/macos/notarize.sh | 4 ++-- .ci/update-github-release.sh | 2 +- .gitlab-ci.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/macos/notarize.sh b/.ci/macos/notarize.sh index cb3d3ef7..345f4828 100755 --- a/.ci/macos/notarize.sh +++ b/.ci/macos/notarize.sh @@ -97,7 +97,7 @@ done VERSION=${CI_COMMIT_SHORT_SHA} if [ -n "$VERSION" ]; then - mv nheko.dmg "nheko-${VERSION}_${PLAT}.dmg" + mv nheko.dmg "nheko-${VERSION}-${PLAT}.dmg" mkdir -p artifacts - cp "nheko-${VERSION}_${PLAT}.dmg" artifacts/ + cp "nheko-${VERSION}-${PLAT}.dmg" artifacts/ fi \ No newline at end of file diff --git a/.ci/update-github-release.sh b/.ci/update-github-release.sh index ac643987..234c1f41 100755 --- a/.ci/update-github-release.sh +++ b/.ci/update-github-release.sh @@ -43,7 +43,7 @@ elif [ "$http_code" = "200" ]; then fi echo "Getting upload URL..." -upload_url="$(echo "$release_json" | jq '."upload_url"')" +upload_url="$(echo "$release_json" | jq -r '."upload_url"')" # get rid of the 'hypermedia' stuff at the end and use a 'real' URL echo "Upload URL (hypermedia): ${upload_url}" upload_url="$(echo "$upload_url" | sed 's/{?name,label\}/?name/g')" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92e11338..460d9c9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -151,7 +151,7 @@ codesign-macos: - export PATH=/usr/local/opt/qt@5/bin/:${PATH} - ./.ci/macos/notarize.sh after_script: - - ./.ci/upload-nightly-gitlab.sh artifacts/nheko-${CI_COMMIT_SHORT_SHA}_${PLAT}.dmg + - ./.ci/upload-nightly-gitlab.sh artifacts/nheko-${CI_COMMIT_SHORT_SHA}-${PLAT}.dmg needs: - job: build-macos optional: true # optional since we want to be able to also trigger this job from cirrus ci for apple silicon builds. From e7275386038708c1868fa39f98ee1f8fcef139c9 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 28 Feb 2023 17:44:22 -0500 Subject: [PATCH 17/17] Remove test configurations --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 460d9c9c..c386b4c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -186,7 +186,7 @@ build-flatpak-amd64: after_script: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-amd64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true - - (cd $CI_BUILDS_DIR && mkdir -p artifacts && cp build-flatpak/nheko-amd64.flatpak artifacts/) || true + - (cd .. && mkdir -p artifacts && cp build-flatpak/nheko-amd64.flatpak artifacts/) || true rules: - if : '$CI_PIPELINE_TRIGGERED == null' cache: @@ -218,9 +218,9 @@ build-flatpak-arm64: after_script: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak - (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true - - (cd $CI_BUILDS_DIR && mkdir -p artifacts && cp build-flatpak/nheko-arm64.flatpak artifacts/) || true + - (cd .. && mkdir -p artifacts && cp build-flatpak/nheko-arm64.flatpak artifacts/) || true rules: - - if : '$CI_PIPELINE_TRIGGERED == "123456"' + - if : '$CI_PIPELINE_TRIGGERED == null' cache: key: "$CI_JOB_NAME" paths: @@ -316,7 +316,7 @@ github-release: image: alpine:latest tags: [docker] rules: - - if: '$CI_COMMIT_TAG =~ /^test\d+\.\d+\.\d+$/' + - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' dependencies: - appimage-amd64 - build-flatpak-arm64