|
1 | | -name: Build Executables |
| 1 | +name: Build Executables and Create Release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
13 | 13 | steps: |
14 | 14 | - name: Checkout code |
15 | 15 | uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 # Fetch all history for tags |
16 | 18 |
|
17 | 19 | - name: Set up Python |
18 | 20 | uses: actions/setup-python@v5 |
|
47 | 49 | Copy-Item "dist\import_opc_nodes.exe" -Destination "artifacts\" -Force |
48 | 50 | Copy-Item "dist\create_nodes_from_export.exe" -Destination "artifacts\" -Force |
49 | 51 | |
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) |
51 | 88 | uses: actions/upload-artifact@v4 |
52 | 89 | with: |
53 | 90 | name: windows-executables |
|
0 commit comments