Skip to content

Commit 9404fd5

Browse files
committed
Introduce a workflow for an automated release creation
1 parent 41fe7ab commit 9404fd5

File tree

7 files changed

+224
-9
lines changed

7 files changed

+224
-9
lines changed

.github/RELEASE_TEMPLATE.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Module Name: communication
2+
Release Tag: <release-tag>
3+
Origin Release Tag: <previous-release-tag>
4+
Release Commit Hash: <commit-sha>
5+
Release Date: <release-date>
6+
7+
Overview
8+
--------
9+
The communication module provides a generic communication frontend with an IPC binding for use in the S-CORE project.
10+
11+
The module is available as a Bazel module in the S-CORE Bazel registry: https://github.com/eclipse-score/bazel_registry/tree/main/modules/score_communication
12+
13+
Disclaimer
14+
----------
15+
This release is not intended for production use, as it does not include a safety argumentation or a completed safety assessment.
16+
The work products compiled in the safety package are created with care according to the [S-CORE process](https://eclipse-score.github.io/process_description/main/index.html). However, as a non-profit, open-source organization, the project cannot assume any liability for its content.
17+
18+
For details on the features, see https://eclipse-score.github.io/score/main/features/communication/index.html
19+
20+
Improvements
21+
------------
22+
23+
24+
Bug Fixes
25+
---------
26+
27+
Compatibility
28+
-------------
29+
- `x86_64-unknown-linux-gnu` using [score_toolchains_gcc](https://github.com/eclipse-score/toolchains_gcc)
30+
- `x86_64-unknown-linux-gnu` using [toolchains_llvm](https://github.com/bazel-contrib/toolchains_llvm)
31+
- `x86_64-unknown-nto-qnx800` using [score_toolchains_qnx](https://github.com/eclipse-score/toolchains_qnx)
32+
- `aarch64-unknown-nto-qnx800` using [score_toolchains_qnx](https://github.com/eclipse-score/toolchains_qnx)
33+
34+
35+
Performed Verification
36+
----------------------
37+
- Unit test execution on host with all supported toolchains
38+
- Build on supported target platforms (QNX8 x86_64 and QNX8 aarch64)
39+
- Thread sanitized unit test execution
40+
- Address and UB sanitized unit test execution
41+
- Leak sanitized unit test execution
42+
43+
Known Issues
44+
------------
45+
46+
47+
Upgrade Instructions
48+
--------------------
49+
Backward compatibility with the previous release is not guaranteed.
50+
51+
Contact Information
52+
-------------------
53+
For any questions or support, please raise an issue/discussion.

.github/workflows/address_undefined_behavior_leak_sanitizer.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ on:
2121
types: [opened, reopened, synchronize]
2222
merge_group:
2323
types: [checks_requested]
24-
release:
25-
types: [created]
24+
workflow_call:
2625
jobs:
2726
build_and_test_asan_ubsan_lsan:
2827
# Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
# Workflow configuration for automated release process
15+
# This workflow is triggered when a tag matching "trigger-release-vX.X.X" is pushed.
16+
# It creates a draft release, runs all tests, and either leaves or removes the draft release based on results.
17+
18+
name: Automated Release Process
19+
on:
20+
push:
21+
tags:
22+
- 'trigger-release-v[0-9]+.[0-9]+.[0-9]+'
23+
24+
jobs:
25+
create-draft-release:
26+
runs-on: ubuntu-22.04
27+
permissions:
28+
contents: write
29+
pull-requests: read
30+
outputs:
31+
release-id: ${{ steps.create-release.outputs.id }}
32+
release-url: ${{ steps.create-release.outputs.url }}
33+
release-tag: ${{ steps.extract-version.outputs.release-tag }}
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/[email protected]
37+
38+
- name: Extract version from trigger tag
39+
id: extract-version
40+
run: |
41+
TRIGGER_TAG="${GITHUB_REF#refs/tags/}"
42+
echo "Trigger tag: $TRIGGER_TAG"
43+
44+
# Extract version from trigger-release-vX.X.X
45+
RELEASE_VERSION="${TRIGGER_TAG#trigger-release-}"
46+
echo "Release version tag: $RELEASE_VERSION"
47+
echo "release-tag=$RELEASE_VERSION" >> $GITHUB_OUTPUT
48+
49+
- name: Create draft release
50+
id: create-release
51+
uses: softprops/action-gh-release@v2
52+
with:
53+
tag_name: ${{ steps.extract-version.outputs.release-tag }}
54+
name: ${{ steps.extract-version.outputs.release-tag }}
55+
body_path: .github/RELEASE_TEMPLATE.md
56+
draft: true
57+
prerelease: false
58+
target_commitish: ${{ github.sha }}
59+
60+
run-build-and-test-host:
61+
needs: create-draft-release
62+
uses: ./.github/workflows/build_and_test_host.yml
63+
64+
run-build-and-test-qnx:
65+
needs: create-draft-release
66+
uses: ./.github/workflows/build_and_test_qnx.yml
67+
permissions:
68+
contents: read
69+
pull-requests: read
70+
secrets:
71+
inherit: true
72+
73+
run-thread-sanitizer:
74+
needs: create-draft-release
75+
uses: ./.github/workflows/thread_sanitizer.yml
76+
77+
run-address-sanitizer:
78+
needs: create-draft-release
79+
uses: ./.github/workflows/address_undefined_behavior_leak_sanitizer.yml
80+
81+
run-coverage-report:
82+
needs: create-draft-release
83+
uses: ./.github/workflows/release_coverage_report.yml
84+
with:
85+
release_tag: ${{ needs.create-draft-release.outputs.release-tag }}
86+
permissions:
87+
contents: write
88+
89+
finalize-release:
90+
runs-on: ubuntu-22.04
91+
needs:
92+
- create-draft-release
93+
- run-build-and-test-host
94+
- run-build-and-test-qnx
95+
- run-thread-sanitizer
96+
- run-address-sanitizer
97+
- run-coverage-report
98+
if: always()
99+
permissions:
100+
contents: write
101+
steps:
102+
- name: Checkout repository
103+
uses: actions/[email protected]
104+
105+
- name: Check workflow results
106+
id: check-results
107+
run: |
108+
RESULT_HOST="${{ needs.run-build-and-test-host.result }}"
109+
RESULT_QNX="${{ needs.run-build-and-test-qnx.result }}"
110+
RESULT_TSAN="${{ needs.run-thread-sanitizer.result }}"
111+
RESULT_ASAN="${{ needs.run-address-sanitizer.result }}"
112+
RESULT_COVERAGE="${{ needs.run-coverage-report.result }}"
113+
114+
echo "Build and test host: $RESULT_HOST"
115+
echo "Build and test QNX: $RESULT_QNX"
116+
echo "Thread sanitizer: $RESULT_TSAN"
117+
echo "Address sanitizer: $RESULT_ASAN"
118+
echo "Coverage report: $RESULT_COVERAGE"
119+
120+
if [[ "$RESULT_HOST" == "success" ]] && \
121+
[[ "$RESULT_QNX" == "success" ]] && \
122+
[[ "$RESULT_TSAN" == "success" ]] && \
123+
[[ "$RESULT_ASAN" == "success" ]] && \
124+
[[ "$RESULT_COVERAGE" == "success" ]]; then
125+
echo "all-success=true" >> $GITHUB_OUTPUT
126+
else
127+
echo "all-success=false" >> $GITHUB_OUTPUT
128+
fi
129+
130+
- name: Delete trigger tag (on success)
131+
if: steps.check-results.outputs.all-success == 'true'
132+
run: |
133+
gh api repos/${{ github.repository }}/git/refs/tags/${{ github.ref_name }} -X DELETE
134+
env:
135+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
137+
- name: Keep draft release (on success)
138+
if: steps.check-results.outputs.all-success == 'true'
139+
run: |
140+
echo "All workflows succeeded. Draft release ${{ needs.create-draft-release.outputs.release-tag }} remains available for manual publishing."
141+
142+
- name: Delete draft release (on failure)
143+
if: steps.check-results.outputs.all-success == 'false'
144+
run: |
145+
gh release delete ${{ needs.create-draft-release.outputs.release-tag }} --yes
146+
env:
147+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148+
149+
- name: Report failure
150+
if: steps.check-results.outputs.all-success == 'false'
151+
run: |
152+
echo "❌ One or more workflows failed. Draft release has been deleted."
153+
exit 1
154+
155+
- name: Report success
156+
if: steps.check-results.outputs.all-success == 'true'
157+
run: |
158+
echo "✅ All workflows succeeded. Draft release ${{ needs.create-draft-release.outputs.release-tag }} is ready for manual publishing."
159+
echo "Trigger tag has been removed."

.github/workflows/build_and_test_host.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ on:
2020
types: [opened, reopened, synchronize]
2121
merge_group:
2222
types: [checks_requested]
23-
release:
24-
types: [created]
23+
workflow_call:
2524
jobs:
2625
build_and_test_host:
2726
strategy:

.github/workflows/build_and_test_qnx.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ on:
2020
types: [opened, reopened, synchronize]
2121
merge_group:
2222
types: [checks_requested]
23-
release:
24-
types: [created]
23+
workflow_call:
2524
env:
2625
LICENSE_DIR: "/opt/score_qnx/license"
2726
jobs:

.github/workflows/release_coverage_report.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ name: Coverage Report
1414

1515
on:
1616
release:
17-
types: [ created ]
17+
types: [created,edited]
18+
workflow_call:
19+
inputs:
20+
release_tag:
21+
description: 'Release tag to upload artifacts to'
22+
required: false
23+
type: string
1824

1925
jobs:
2026
coverage-report:
@@ -72,5 +78,6 @@ jobs:
7278
uses: softprops/[email protected]
7379
with:
7480
files: ${{ github.event.repository.name }}_coverage_report.zip
81+
tag_name: ${{ inputs.release_tag || github.ref_name }}
7582
env:
7683
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/thread_sanitizer.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ on:
2020
types: [opened, reopened, synchronize]
2121
merge_group:
2222
types: [checks_requested]
23-
release:
24-
types: [created]
23+
workflow_call:
2524
jobs:
2625
build_and_test_tsan:
2726
# Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081

0 commit comments

Comments
 (0)