Skip to content

Commit 131ae9a

Browse files
committed
autorelease on master push
1 parent 532dd33 commit 131ae9a

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Executables
1+
name: Build Executables and Create Release
22

33
on:
44
push:
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Fetch all history for tags
1618

1719
- name: Set up Python
1820
uses: actions/setup-python@v5
@@ -47,7 +49,42 @@ jobs:
4749
Copy-Item "dist\import_opc_nodes.exe" -Destination "artifacts\" -Force
4850
Copy-Item "dist\create_nodes_from_export.exe" -Destination "artifacts\" -Force
4951
50-
- name: Upload artifacts
52+
- name: Generate version tag
53+
id: version
54+
run: |
55+
$date = Get-Date -Format "yyyy.MM.dd"
56+
$shortSha = "${{ github.sha }}".Substring(0, 7)
57+
$version = "$date-$shortSha"
58+
echo "VERSION=$version" >> $env:GITHUB_ENV
59+
echo "version=$version" >> $env:GITHUB_OUTPUT
60+
Write-Host "Version: $version"
61+
62+
- name: Create Release
63+
uses: softprops/action-gh-release@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
tag_name: v${{ env.VERSION }}
68+
name: Release v${{ env.VERSION }}
69+
body: |
70+
Automated release from commit ${{ github.sha }}
71+
72+
**Executables included:**
73+
- `export_opc_nodes.exe` - Export OPC UA nodes/values to JSON
74+
- `import_opc_nodes.exe` - Import OPC UA nodes/values from JSON
75+
- `create_nodes_from_export.exe` - Create OPC UA server from export file
76+
77+
**Build Date:** ${{ github.event.head_commit.timestamp }}
78+
**Commit:** ${{ github.sha }}
79+
**Commit Message:** ${{ github.event.head_commit.message }}
80+
draft: false
81+
prerelease: false
82+
files: |
83+
artifacts/export_opc_nodes.exe
84+
artifacts/import_opc_nodes.exe
85+
artifacts/create_nodes_from_export.exe
86+
87+
- name: Upload artifacts (for workflow artifacts)
5188
uses: actions/upload-artifact@v4
5289
with:
5390
name: windows-executables

0 commit comments

Comments
 (0)