Skip to content
Snippets Groups Projects
Commit 7a1cc4f2 authored by Leon Schmidt's avatar Leon Schmidt
Browse files

Merge branch 'ci-updates' into 'main'

Add Gotify Go Version-dependent releases

Closes #1

See merge request !3
parents 9fa7a4d9 8bf0ac1a
No related branches found
Tags 1.0.1
1 merge request!3Add Gotify Go Version-dependent releases
Checking pipeline status
......@@ -27,31 +27,47 @@ push-plugin:
stage: upload
rules:
- if: $CI_COMMIT_TAG
needs:
- job: build-plugin
artifacts: true
image: curlimages/curl
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/gotify-webhooks-linux-amd64.so "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}/gotify-webhooks-linux-amd64.so"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/gotify-webhooks-linux-arm-7.so "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}/gotify-webhooks-linux-arm-7.so"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/gotify-webhooks-linux-arm64.so "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}/gotify-webhooks-linux-arm64.so"'
# prepare go version variable for release
# see https://docs.gitlab.com/ee/user/project/releases/release_cicd_examples.html#create-release-metadata-in-a-custom-script
- 'export GO_VERS=$(cat build/gotify-server-go-version)'
- 'echo "GO_VERS=$GO_VERS" > variables.env'
# check if upload already exists
- 'if curl --head --output /dev/null --fail "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-amd64.so"; then echo "Package already exists!"; false; else true; fi'
# upload
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/gotify-webhooks-linux-amd64.so "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-amd64.so"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/gotify-webhooks-linux-arm-7.so "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-arm-7.so"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/gotify-webhooks-linux-arm64.so "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-arm64.so"'
artifacts:
reports:
dotenv: variables.env
release-plugin:
stage: release
rules:
- if: $CI_COMMIT_TAG
needs:
- job: push-plugin
artifacts: true
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Doing release"
- 'echo "Releasing ${CI_COMMIT_TAG}_go${GO_VERS}"'
release:
name: "Release $CI_COMMIT_TAG"
description: "Release for version $CI_COMMIT_TAG for the Gotify Webhooks Plugin"
name: "Release ${CI_COMMIT_TAG}_go${GO_VERS}"
description: "Release for version ${CI_COMMIT_TAG}_go${GO_VERS} for the Gotify Webhooks Plugin, compatible with all version of Gotify built with Go ${GO_VERS}"
tag_name: "$CI_COMMIT_TAG"
assets:
links:
- name: gotify-webhooks-linux-amd64.so
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}/gotify-webhooks-linux-amd64.so"
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-amd64.so"
link_type: package
- name: gotify-webhooks-linux-arm-7.so
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}/gotify-webhooks-linux-arm-7.so"
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-arm-7.so"
link_type: package
- name: gotify-webhooks-linux-arm64.so
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}/gotify-webhooks-linux-arm64.so"
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gotify-webhooks/${CI_COMMIT_TAG}_go${GO_VERS}/gotify-webhooks-linux-arm64.so"
link_type: package
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment