@@ -11,142 +11,5 @@ permissions:
1111
1212jobs :
1313 release_tag :
14- name : Release version
15- runs-on : ubuntu-24.04
16- steps :
17- - name : Create GitHub App token
18- uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2
19- id : app-token
20- with :
21- # required
22- app-id : 1312871
23- private-key : ${{ secrets.OPENMCP_CI_APP_PRIVATE_KEY }}
24-
25- - name : Checkout code
26- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
27- with :
28- token : ${{ steps.app-token.outputs.token }}
29- fetch-tags : true
30- fetch-depth : 0
31- submodules : recursive
32-
33- - name : Install Task
34- uses : arduino/setup-task@v2
35- with :
36- version : 3.x
37-
38- - name : Read and validate VERSION
39- id : version
40- run : |
41- VERSION=$(task version)
42- if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev(-[0-9a-f]*)?)?$ ]]; then
43- echo "Invalid version format: $VERSION"
44- exit 1
45- fi
46- echo "New version: $VERSION"
47- echo "version=$VERSION" >> $GITHUB_ENV
48-
49- - name : Skip release if version is a dev version
50- if : contains(env.version, '-dev')
51- run : |
52- echo "Skipping development version release: ${{ env.version }}"
53- echo "SKIP=true" >> $GITHUB_ENV
54- exit 0
55-
56- - name : Check if VERSION is already tagged
57- id : check_tag
58- run : |
59- if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then
60- echo "Tag ${{ env.version }} already exists. Skipping release."
61- echo "SKIP=true" >> $GITHUB_ENV
62- exit 0
63- fi
64- echo "Tag ${{ env.version }} doesn't exists. Proceeding with release."
65-
66- - name : Create Git tag
67- if : ${{ env.SKIP != 'true' }}
68- run : |
69- AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
70- AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
71- echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
72-
73- echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
74- echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
75-
76- git config user.name "$AUTHOR_NAME"
77- git config user.email "$AUTHOR_EMAIL"
78-
79- git tag -a "${{ env.version }}" -m "Release ${{ env.version }}"
80- git push origin "${{ env.version }}"
81-
82- - name : Create Git tag for api submodule
83- if : ${{ env.SKIP != 'true' }}
84- run : |
85- AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
86- AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
87- echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
88-
89- echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
90- echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
91-
92- git config user.name "$AUTHOR_NAME"
93- git config user.email "$AUTHOR_EMAIL"
94-
95- git tag -a "api/${{ env.version }}" -m "Release ${{ env.version }}"
96- git push origin "api/${{ env.version }}"
97-
98- - name : Build Changelog
99- id : github_release
100- uses : mikepenz/release-changelog-builder-action@e92187bd633e680ebfdd15961a7c30b2d097e7ad # v5
101- with :
102- mode : " PR"
103- configurationJson : |
104- {
105- "template": "#{{CHANGELOG}}",
106- "pr_template": "- #{{TITLE}}: ##{{NUMBER}}",
107- "categories": [
108- {
109- "title": "## Feature",
110- "labels": ["feat", "feature"]
111- },
112- {
113- "title": "## Fix",
114- "labels": ["fix", "bug"]
115- },
116- {
117- "title": "## Other",
118- "labels": []
119- }
120- ],
121- "label_extractor": [
122- {
123- "pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
124- "on_property": "title",
125- "target": "$1"
126- }
127- ]
128- }
129- env :
130- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131-
132- - name : Create GitHub release
133- if : ${{ env.SKIP != 'true' }}
134- uses : softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
135- with :
136- tag_name : ${{ env.version }}
137- name : Release ${{ env.version }}
138- body : ${{steps.github_release.outputs.changelog}}
139- draft : true
140- prerelease : false
141- env :
142- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
143-
144- - name : Push dev VERSION
145- if : ${{ env.SKIP != 'true' }}
146- run : |
147- task release:set-version --verbose -- "${{ env.version }}-dev"
148- git config user.name "${{ env.AUTHOR_NAME }}"
149- git config user.email "${{ env.AUTHOR_EMAIL }}"
150- git add VERSION
151- git commit -m "Update VERSION to ${{ env.version }}-dev"
152- git push origin main
14+ uses : openmcp-project/build/.github/workflows/release.lib.yaml@main
15+ secrets : inherit
0 commit comments