-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (49 loc) · 1.68 KB
/
release.yml
File metadata and controls
57 lines (49 loc) · 1.68 KB
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
53
54
55
56
57
name: Release
on:
push:
branches: [master]
jobs:
Build:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{secrets.GITHUB_TOKEN}}
- name: Get Project Version
id: project_version
uses: mavrosxristoforos/get-xml-info@1.0
with:
xml-file: "OC_EtherCAT.plcproj"
xpath: "//*[local-name()='ProjectVersion']"
- name: Get Semantic Version
id: semantic_version
uses: cycjimmy/semantic-release-action@v4
with:
dry_run: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Compare Versions
id: compare_versions
run: |
echo "Project XML Version: ${{ steps.project_version.outputs.info }}"
echo "Semantic Version: ${{ steps.semantic_version.outputs.new_release_version}}"
if ${{ steps.project_version.outputs.info == steps.semantic_version.outputs.new_release_version}}; then
echo "Versions match! Proceeding with the release..."
echo "release=true" >> $GITHUB_ENV
else
echo "Error: Project and Semantic versions do not match"
echo "release=false" >> $GITHUB_ENV
exit 1
fi
- name: Semantic release
if: env.release == 'true'
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}