-
Notifications
You must be signed in to change notification settings - Fork 8
/
release.yml
52 lines (47 loc) · 2.79 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
image: alpine:latest
prepare:
rules:
- if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
script:
- apk update && apk add bash curl jq yq
- curl -L https://github.com/regclient/regclient/releases/download/v0.6.0/regctl-linux-amd64 > /usr/bin/regctl
# generated with 'sha256sum -b regctl > SHA256SUMS'.
- echo "44216c0ab3bd41ae30b07392d6cdab6971f48ab3f72400e617f5f0ded4d70742 /usr/bin/regctl" > SHA256SUMS
- if ! sha256sum -c SHA256SUMS; then echo "Checksum for regctl has failed"; fi
- chmod 755 /usr/bin/regctl
- regctl registry login docker.io -u $DOCKERHUB_USER -p $DOCKERHUB_TOKEN
- chmod +x ./ci-scripts/release/deploy.sh
# TODO: get the name of the branch instead of hard-coding "stable-rc" here.
# Particularly annoying to achieve because this job runs inside a tag pipeline, not a branch one, where
# CI_COMMIT_BRANCH is not defined for tag pipelines and tags can refer to commits in multiple branches.
- ./ci-scripts/release/deploy.sh $(realpath ./ci-scripts/container-versions/cross-toolchains.yml) $PROJECT_SETTING_REGISTRY_NAMESPACE "stable-rc"
- ./ci-scripts/release/deploy.sh $(realpath ./ci-scripts/container-versions/debian-am62.yml) $PROJECT_SETTING_REGISTRY_NAMESPACE "stable-rc"
- ./ci-scripts/release/deploy.sh $(realpath ./ci-scripts/container-versions/debian-imx8.yml) $PROJECT_SETTING_REGISTRY_NAMESPACE "stable-rc"
- ./ci-scripts/release/deploy.sh $(realpath ./ci-scripts/container-versions/debian-upstream.yml) $PROJECT_SETTING_REGISTRY_NAMESPACE "stable-rc"
- ./ci-scripts/release/deploy.sh $(realpath ./ci-scripts/container-versions/dotnet-8.yml) $PROJECT_SETTING_REGISTRY_NAMESPACE "stable-rc"
- ./ci-scripts/release/deploy.sh $(realpath ./ci-scripts/container-versions/rt-tests.yml) $PROJECT_SETTING_REGISTRY_NAMESPACE "stable-rc"
artifacts:
paths:
- release_notes.md
release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
before_script:
- apk update && apk add curl
needs:
- job: prepare
artifacts: true
rules:
- if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
script:
- echo "Creating release"
- chmod +x ./ci-scripts/release/send-slack-message.sh
- export base_message="Torizon Containers release $CI_COMMIT_TAG!"
- export link="https://gitlab.int.toradex.com/rd/torizon-core-containers/torizon-containers/-/releases/$CI_COMMIT_TAG"
- export newline="\n" formatted_link="<${link}|Click here for the changelog>"
- ./ci-scripts/release/send-slack-message.sh $TCCP_CHANNEL_ID $SLACK_TOKEN "$base_message$newline$formatted_link"
- ./ci-scripts/release/send-slack-message.sh $TECH_MKT_CHANNEL_ID $SLACK_TOKEN "$base_message$newline$formatted_link"
release:
name: "Release $CI_COMMIT_TAG"
description: release_notes.md
tag_name: "$CI_COMMIT_TAG"
ref: "$CI_COMMIT_SHA"