Skip to content

Commit

Permalink
Merge branch 'feature/release_notifications' into 'main'
Browse files Browse the repository at this point in the history
Add release notifications

Closes #249

See merge request syntron/support/csr/ifm3d/ifm3d!315
  • Loading branch information
BigBoot committed Aug 3, 2023
2 parents 5d06c2c + cee486e commit 7dedfe7
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ include:
- local: .gitlab/deploy_docker.yml
- local: .gitlab/oss_compilance.yml
- local: .gitlab/deploy_github.yml
- local: .gitlab/notification.yml
2 changes: 2 additions & 0 deletions .gitlab/deploy_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ deploy:github:
GH_TOKEN: ${IFM_CSR_GH_RELEASE_TOKEN}
stage: deploy
image: ghcr.io/cicirello/pyaction
tags:
- shared_docker
needs:
- job: release:github
artifacts: false
Expand Down
38 changes: 38 additions & 0 deletions .gitlab/notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
release:teams_notification:
stage: release
image:
name: quay.io/curl/curl:latest
entrypoint: [""]
tags:
- shared_docker
rules:
- !reference [.tagged, rules]
needs:
- job: release:github
artifacts: false
script:
- export VERSION=$(echo ${CI_COMMIT_TAG} | cut -c 2-)
- >
cat .gitlab/pre_release_card.json
| sed "s|%%VERSION%%|${VERSION}|g"
| sed "s|%%PRE_RELEASE_PYTHON_INDEX%%|${TEST_PYTHON_REPO_URL}|g"
| curl -H "Content-Type: application/json" -d @- ${TEAMS_WEBHOOK_URL}'
deploy:teams_notification:
stage: deploy
image:
name: quay.io/curl/curl:latest
entrypoint: [""]
tags:
- shared_docker
rules:
- !reference [.tagged, rules]
needs:
- job: deploy:start
artifacts: false
script:
- export VERSION=$(echo ${CI_COMMIT_TAG} | cut -c 2-)
- >
cat .gitlab/pre_release_card.json
| sed "s|%%VERSION%%|${VERSION}|g"
| curl -H "Content-Type: application/json" -d @- ${TEAMS_WEBHOOK_URL}'
154 changes: 154 additions & 0 deletions .gitlab/pre_release_card.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"summary": "ifm3d release v%%VERSION%%",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"width": "32px",
"items": [
{
"type": "Image",
"width": "16px",
"horizontalAlignment": "Center",
"url": "https://avatars.githubusercontent.com/u/43432334",
"altText": "ifm Logo"
}
],
"type": "Column",
"padding": "None"
},
{
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "**ifm3d version %%VERSION%% [pre-release]**",
"size": "ExtraLarge"
}
],
"type": "Column",
"padding": "None"
}
],
"padding": "None"
},
{
"type": "ColumnSet",
"spacing": "Large",
"separator": true,
"columns": [
{
"width": "stretch",
"items": [
{
"type": "TextBlock",
"spacing": "None",
"text": "The pre-release for ifm3d v%%VERSION%% is ready for testing and can be downloaded from %%PRE_RELEASE_PYTHON_INDEX%%:",
"wrap": true
}
],
"type": "Column",
"padding": "None"
}
],
"padding": "None"
},
{
"type": "Container",
"id": "3823f8bf-ac06-4344-7bd1-940cf3c6bb46",
"padding": "None",
"items": [
{
"type": "TextBlock",
"id": "6f94d820-6945-51d2-f609-42307cafd863",
"text": "pip install --extra-index-url %%PRE_RELEASE_PYTHON_INDEX%%/simple ifm3dpy==%%VERSION%%",
"wrap": true
}
],
"style": "emphasis"
},
{
"type": "TextBlock",
"id": "75aaa9e3-3798-e73d-60a6-c5e6cb74dc7f",
"text": "Docker images are also available as always from GHCR/DockerHub.",
"wrap": true
},
{
"type": "TextBlock",
"id": "ec6c9079-c992-88f0-0635-57e94a6d72d9",
"text": "Please let us know if any problems arise.",
"wrap": true
},
{
"type": "TextBlock",
"id": "9b04b7de-41a6-574f-d8f3-46e13b941f45",
"text": "⚠ This is a pre-release and might contain bugs, we recommed not to use this version in production code",
"wrap": true
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": "stretch",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.OpenUrl",
"id": "e80abe00-7b9a-95e8-023a-7d654b2909d9",
"title": "GitHub Release",
"url": "https://github.com/ifm/ifm3d/releases/tag/v%%VERSION%%"
},
{
"type": "Action.OpenUrl",
"id": "627d7eb8-62e8-a5d7-80d5-1b86cf88bdcd",
"title": "Changelog",
"url": "https://github.com/ifm/ifm3d/blob/main/ChangeLog.md"
},
{
"type": "Action.OpenUrl",
"id": "8e2233c9-5f92-f457-c4a3-eeae74677631",
"title": "Migration Guide",
"url": "https://api.ifm3d.com/latest/content/migration_guide/index.html"
},
{
"type": "Action.OpenUrl",
"id": "a447a455-9c3d-843b-f5a9-f030bd1222ce",
"title": "Documentation",
"url": "https://api.ifm3d.com/latest/"
}
]
}
],
"type": "Column",
"padding": "None"
}
],
"padding": "None"
}
],
"padding": "None"
}
],
"padding": "Default",
"msteams": {
"width": "Full"
}
}
}
]
}
2 changes: 2 additions & 0 deletions .gitlab/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ release:github:
GH_TOKEN: ${IFM_CSR_GH_RELEASE_TOKEN}
stage: release
image: ghcr.io/cicirello/pyaction
tags:
- shared_docker
needs:
- job: build:linux:deb
artifacts: true
Expand Down
148 changes: 148 additions & 0 deletions .gitlab/release_card.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"summary": "ifm3d release v%%VERSION%%",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"width": "32px",
"items": [
{
"type": "Image",
"width": "16px",
"horizontalAlignment": "Center",
"url": "https://avatars.githubusercontent.com/u/43432334",
"altText": "ifm Logo"
}
],
"type": "Column",
"padding": "None"
},
{
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "**ifm3d version %%VERSION%%**",
"size": "ExtraLarge"
}
],
"type": "Column",
"padding": "None"
}
],
"padding": "None"
},
{
"type": "ColumnSet",
"spacing": "Large",
"separator": true,
"columns": [
{
"width": "stretch",
"items": [
{
"type": "TextBlock",
"spacing": "None",
"text": "ifm3d v%%VERSION%% has been released and can be downloaded from https://pypi.org/project/ifm3dpy/:",
"wrap": true
}
],
"type": "Column",
"padding": "None"
}
],
"padding": "None"
},
{
"type": "Container",
"id": "3823f8bf-ac06-4344-7bd1-940cf3c6bb46",
"padding": "None",
"items": [
{
"type": "TextBlock",
"id": "6f94d820-6945-51d2-f609-42307cafd863",
"text": "pip install ifm3dpy==%%VERSION%%",
"wrap": true
}
],
"style": "emphasis"
},
{
"type": "TextBlock",
"id": "75aaa9e3-3798-e73d-60a6-c5e6cb74dc7f",
"text": "Docker images are also available as always from GHCR/DockerHub.",
"wrap": true
},
{
"type": "TextBlock",
"id": "ec6c9079-c992-88f0-0635-57e94a6d72d9",
"text": "Please let us know if any problems arise.",
"wrap": true
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": "stretch",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.OpenUrl",
"id": "e80abe00-7b9a-95e8-023a-7d654b2909d9",
"title": "GitHub Release",
"url": "https://github.com/ifm/ifm3d/releases/tag/v%%VERSION%%"
},
{
"type": "Action.OpenUrl",
"id": "627d7eb8-62e8-a5d7-80d5-1b86cf88bdcd",
"title": "Changelog",
"url": "https://github.com/ifm/ifm3d/blob/main/ChangeLog.md"
},
{
"type": "Action.OpenUrl",
"id": "8e2233c9-5f92-f457-c4a3-eeae74677631",
"title": "Migration Guide",
"url": "https://api.ifm3d.com/latest/content/migration_guide/index.html"
},
{
"type": "Action.OpenUrl",
"id": "a447a455-9c3d-843b-f5a9-f030bd1222ce",
"title": "Documentation",
"url": "https://api.ifm3d.com/v%%VERSION%%/"
}
]
}
],
"type": "Column",
"padding": "None"
}
],
"padding": "None"
}
],
"padding": "None"
}
],
"padding": "Default",
"msteams": {
"width": "Full"
}
}
}
]
}

0 comments on commit 7dedfe7

Please sign in to comment.