diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 732e2faf..501976dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,17 +70,43 @@ upload-windows: image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest tags: [docker] rules: - - if : '$CI_PIPELINE_TRIGGERED == null && $CI_COMMIT_REF_PROTECTED == "true"' + - if: '$CI_PIPELINE_TRIGGERED == null && $CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' + variables: + PACKAGE_NAME: "windows" + - if: '$CI_PIPELINE_TRIGGERED == null && $CI_COMMIT_REF_PROTECTED == "true"' variables: GIT_STRATEGY: none + PACKAGE_NAME: "windows-nightly" before_script: - apk add curl unzip script: - export VERSION=$(unzip -p artifacts/nheko.msix AppxManifest.xml | sed -n 's/.* Version="\([0-9.]*\)".*/\1/p') - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file artifacts/nheko.msix "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/windows-nightly/${VERSION}/nheko.msix"' + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file artifacts/nheko.msix "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${VERSION}/nheko.msix"' needs: - job: codesign-windows +pages: + stage: deploy + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest + tags: [docker] + rules: + - if: '$CI_PIPELINE_TRIGGERED == null && $CI_COMMIT_REF_PROTECTED == "true"' + interruptible: true + before_script: + - apk add curl jq + script: + - export LATEST_WINDOWS_NIGHTLY=$(curl "https://nheko.im/api/v4/projects/2/packages?package_name=windows-nightly&order_by=version&sort=desc" | jq -r '.[0].version') + - sed "s/0.11.3.4/${LATEST_WINDOWS_NIGHTLY}/g" -i resources/NhekoNightly.appinstaller + - mkdir public + - mv resources/NhekoNightly.appinstaller public + needs: + - job: upload-windows + optional: true + artifacts: false + artifacts: + paths: + - public + build-clazy: stage: build image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest diff --git a/resources/NhekoNightly.appinstaller b/resources/NhekoNightly.appinstaller new file mode 100644 index 00000000..bd94f5d9 --- /dev/null +++ b/resources/NhekoNightly.appinstaller @@ -0,0 +1,10 @@ + + + + + + + true + + +