Skip to content

Commit d5414f7

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

File tree

7 files changed

+235
-15
lines changed

7 files changed

+235
-15
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: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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+
outputs:
30+
release-id: ${{ steps.create-release.outputs.id }}
31+
release-url: ${{ steps.create-release.outputs.url }}
32+
release-tag: ${{ steps.extract-version.outputs.release-tag }}
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4.2.2
36+
37+
- name: Extract version from trigger tag
38+
id: extract-version
39+
run: |
40+
TRIGGER_TAG="${GITHUB_REF#refs/tags/}"
41+
echo "Trigger tag: $TRIGGER_TAG"
42+
43+
# Extract version from trigger-release-vX.X.X
44+
RELEASE_VERSION="${TRIGGER_TAG#trigger-release-}"
45+
echo "Release version tag: $RELEASE_VERSION"
46+
echo "release-tag=$RELEASE_VERSION" >> $GITHUB_OUTPUT
47+
48+
- name: Create draft release
49+
id: create-release
50+
uses: softprops/action-gh-release@v2
51+
with:
52+
tag_name: ${{ steps.extract-version.outputs.release-tag }}
53+
name: ${{ steps.extract-version.outputs.release-tag }}
54+
body_path: .github/RELEASE_TEMPLATE.md
55+
draft: true
56+
prerelease: false
57+
target_commitish: ${{ github.sha }}
58+
59+
run-build-and-test-host:
60+
needs: create-draft-release
61+
uses: ./.github/workflows/build_and_test_host.yml
62+
63+
run-build-and-test-qnx:
64+
needs: create-draft-release
65+
uses: ./.github/workflows/build_and_test_qnx.yml
66+
permissions:
67+
contents: read
68+
pull-requests: read
69+
secrets:
70+
SCORE_QNX_LICENSE: ${{ secrets.SCORE_QNX_LICENSE }}
71+
SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }}
72+
SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }}
73+
74+
run-thread-sanitizer:
75+
needs: create-draft-release
76+
uses: ./.github/workflows/thread_sanitizer.yml
77+
78+
run-address-sanitizer:
79+
needs: create-draft-release
80+
uses: ./.github/workflows/address_undefined_behavior_leak_sanitizer.yml
81+
82+
run-coverage-report:
83+
needs: create-draft-release
84+
uses: ./.github/workflows/release_coverage_report.yml
85+
with:
86+
release_tag: ${{ needs.create-draft-release.outputs.release-tag }}
87+
permissions:
88+
contents: write
89+
90+
finalize-release:
91+
runs-on: ubuntu-22.04
92+
needs:
93+
- create-draft-release
94+
- run-build-and-test-host
95+
- run-build-and-test-qnx
96+
- run-thread-sanitizer
97+
- run-address-sanitizer
98+
- run-coverage-report
99+
if: always()
100+
permissions:
101+
contents: write
102+
steps:
103+
- name: Checkout repository
104+
uses: actions/checkout@v4.2.2
105+
106+
- name: Check workflow results
107+
id: check-results
108+
run: |
109+
RESULT_HOST="${{ needs.run-build-and-test-host.result }}"
110+
RESULT_QNX="${{ needs.run-build-and-test-qnx.result }}"
111+
RESULT_TSAN="${{ needs.run-thread-sanitizer.result }}"
112+
RESULT_ASAN="${{ needs.run-address-sanitizer.result }}"
113+
RESULT_COVERAGE="${{ needs.run-coverage-report.result }}"
114+
115+
echo "Build and test host: $RESULT_HOST"
116+
echo "Build and test QNX: $RESULT_QNX"
117+
echo "Thread sanitizer: $RESULT_TSAN"
118+
echo "Address sanitizer: $RESULT_ASAN"
119+
echo "Coverage report: $RESULT_COVERAGE"
120+
121+
if [[ "$RESULT_HOST" == "success" ]] && \
122+
[[ "$RESULT_QNX" == "success" ]] && \
123+
[[ "$RESULT_TSAN" == "success" ]] && \
124+
[[ "$RESULT_ASAN" == "success" ]] && \
125+
[[ "$RESULT_COVERAGE" == "success" ]]; then
126+
echo "all-success=true" >> $GITHUB_OUTPUT
127+
else
128+
echo "all-success=false" >> $GITHUB_OUTPUT
129+
fi
130+
131+
- name: Delete trigger tag (on success)
132+
if: steps.check-results.outputs.all-success == 'true'
133+
run: |
134+
gh api repos/${{ github.repository }}/git/refs/tags/${{ github.ref_name }} -X DELETE
135+
env:
136+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
138+
- name: Keep draft release (on success)
139+
if: steps.check-results.outputs.all-success == 'true'
140+
run: |
141+
echo "All workflows succeeded. Draft release ${{ needs.create-draft-release.outputs.release-tag }} remains available for manual publishing."
142+
143+
- name: Delete draft release (on failure)
144+
if: steps.check-results.outputs.all-success == 'false'
145+
run: |
146+
gh release delete ${{ needs.create-draft-release.outputs.release-tag }} --yes
147+
env:
148+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149+
150+
- name: Report failure
151+
if: steps.check-results.outputs.all-success == 'false'
152+
run: |
153+
echo "❌ One or more workflows failed. Draft release has been deleted."
154+
exit 1
155+
156+
- name: Report success
157+
if: steps.check-results.outputs.all-success == 'true'
158+
run: |
159+
echo "✅ All workflows succeeded. Draft release ${{ needs.create-draft-release.outputs.release-tag }} is ready for manual publishing."
160+
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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ on:
2020
types: [opened, reopened, synchronize]
2121
merge_group:
2222
types: [checks_requested]
23-
release:
24-
types: [created]
23+
workflow_call:
24+
secrets:
25+
SCORE_QNX_LICENSE:
26+
required: true
27+
SCORE_QNX_USER:
28+
required: true
29+
SCORE_QNX_PASSWORD:
30+
required: true
2531
env:
2632
LICENSE_DIR: "/opt/score_qnx/license"
2733
jobs:

.github/workflows/release_coverage_report.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
name: Coverage Report
1414

1515
on:
16-
release:
17-
types: [ created ]
16+
workflow_call:
17+
inputs:
18+
release_tag:
19+
description: 'Release tag to upload artifacts to'
20+
required: true
21+
type: string
1822

1923
jobs:
2024
coverage-report:
@@ -68,9 +72,9 @@ jobs:
6872
name: ${{ github.event.repository.name }}_coverage_report.zip
6973
path: ${{ github.event.repository.name }}_coverage_report.zip
7074

71-
- name: Upload release asset (attach ZIP to GitHub Release)
72-
uses: softprops/action-gh-release@v2.5.0
73-
with:
74-
files: ${{ github.event.repository.name }}_coverage_report.zip
75+
- name: Upload coverage report to existing draft release
76+
run: |
77+
# Upload the file to the existing release
78+
gh release upload "${{ inputs.release_tag }}" "${{ github.event.repository.name }}_coverage_report.zip"
7579
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
GH_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)