Skip to content

Commit 6ebf01f

Browse files
committed
Automatic release
1 parent 9bb083a commit 6ebf01f

File tree

9 files changed

+222
-4
lines changed

9 files changed

+222
-4
lines changed

.github/workflows/rust.yml

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Rust
33
on:
44
push:
55
branches: [ "main" ]
6+
tags:
7+
- 'plcviz-v*'
68
pull_request:
79
branches: [ "main" ]
810

@@ -11,12 +13,84 @@ env:
1113

1214
jobs:
1315
build:
14-
15-
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest]
19+
20+
runs-on: ${{ matrix.os }}
1621

1722
steps:
1823
- uses: actions/checkout@v4
1924
- name: Build
2025
run: cargo build --verbose
2126
- name: Run tests
2227
run: cargo test --lib --verbose
28+
29+
release:
30+
name: Build and Release
31+
if: startsWith(github.ref, 'refs/tags/')
32+
strategy:
33+
matrix:
34+
include:
35+
- os: ubuntu-latest
36+
target: x86_64-unknown-linux-gnu
37+
suffix: ''
38+
archive: tar.gz
39+
- os: windows-latest
40+
target: x86_64-pc-windows-msvc
41+
suffix: .exe
42+
archive: zip
43+
44+
runs-on: ${{ matrix.os }}
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Extract crate name and version from tag
50+
id: tag
51+
shell: bash
52+
run: |
53+
TAG=${GITHUB_REF#refs/tags/}
54+
CRATE=$(echo $TAG | sed 's/-v.*//')
55+
VERSION=$(echo $TAG | sed 's/.*-v//')
56+
echo "tag=$TAG" >> $GITHUB_OUTPUT
57+
echo "crate=$CRATE" >> $GITHUB_OUTPUT
58+
echo "version=$VERSION" >> $GITHUB_OUTPUT
59+
echo "Building $CRATE version $VERSION"
60+
61+
- name: Build release binary
62+
run: cargo build --release -p ${{ steps.tag.outputs.crate }}
63+
64+
- name: Create release archive (Linux)
65+
if: matrix.os == 'ubuntu-latest'
66+
run: |
67+
mkdir -p release
68+
cp target/release/${{ steps.tag.outputs.crate }} release/
69+
cp ${{ steps.tag.outputs.crate }}/README.md release/ || true
70+
cp ${{ steps.tag.outputs.crate }}/LICENSE release/ || true
71+
cp ${{ steps.tag.outputs.crate }}/CHANGELOG.md release/ || true
72+
cd release
73+
tar czf ../${{ steps.tag.outputs.crate }}-v${{ steps.tag.outputs.version }}-x86_64-linux.tar.gz *
74+
75+
- name: Create release archive (Windows)
76+
if: matrix.os == 'windows-latest'
77+
shell: bash
78+
run: |
79+
mkdir -p release
80+
cp target/release/${{ steps.tag.outputs.crate }}.exe release/
81+
cp ${{ steps.tag.outputs.crate }}/README.md release/ || true
82+
cp ${{ steps.tag.outputs.crate }}/LICENSE release/ || true
83+
cp ${{ steps.tag.outputs.crate }}/CHANGELOG.md release/ || true
84+
cd release
85+
7z a ../${{ steps.tag.outputs.crate }}-v${{ steps.tag.outputs.version }}-x86_64-windows.zip *
86+
87+
- name: Upload Release Asset
88+
uses: softprops/action-gh-release@v1
89+
with:
90+
files: |
91+
${{ steps.tag.outputs.crate }}-v${{ steps.tag.outputs.version }}-*.tar.gz
92+
${{ steps.tag.outputs.crate }}-v${{ steps.tag.outputs.version }}-*.zip
93+
draft: false
94+
prerelease: false
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plcviz-v0.3.2-x86_64-linux.tar.gz

1.96 MB
Binary file not shown.

plcviz/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.3.3 (2025-12-16)
4+
- Automatic release
5+
36
## 0.3.2 (2025-12-16)
47
- Changes to release binary for Linux
58

plcviz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plcviz"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
edition = "2021"
55
description = "PLC code visualization - graphs, dependencies, and documentation"
66
license = "MIT"

release/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
## 0.3.2 (2025-12-16)
4+
- Changes to release binary for Linux
5+
6+
## 0.3.1 (2025-12-14)
7+
8+
### Added
9+
- PLCopen struct member extraction in datatype dependency graphs
10+
- Recursive type reference extraction from:
11+
- Struct members
12+
- Array base types
13+
- Derived (user-defined) types
14+
15+
### Changed
16+
- `build_datatype_graph()` now shows struct member dependencies
17+
- Graph edges display datatype relationships
18+
19+
## 0.3.0 (2025-12-11)
20+
- support for plcopen files
21+
22+
## 0.2.1 (2025-12-05)
23+
- Changes in docs
24+
25+
## 0.2.0 (2025-12-04)
26+
- Added dataflow graph type
27+
- Added `--stats` option
28+
29+
## 0.1.0 (2025-12-01)
30+
- Initial release
31+
- Structure, call, combined graph types
32+
- SVG output with layout-rs

release/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 radevgit
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

release/README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# plcviz
2+
3+
PLC code visualization tool - generate SVG diagrams from L5X (Rockwell) and PLCopen XML (IEC 61131-3) files.
4+
5+
## Example Output
6+
7+
![Example combined graph](img/example.svg)
8+
9+
## Features
10+
11+
- **Structure graphs**: Program/POU containment hierarchy
12+
- **Call graphs**: Function/FB call relationships
13+
- **DataType dependency graphs**: UDT nesting relationships (PLCopen)
14+
- **Multiple formats**: L5X (Rockwell) and PLCopen XML (Siemens, CODESYS, Beckhoff, B&R)
15+
- **Multiple export types**: Controller, Program, and AOI exports (L5X)
16+
17+
## Supported Formats
18+
19+
### L5X (Rockwell Automation)
20+
- Logix5000 / Studio 5000 exports (.L5X)
21+
- ControlLogix, CompactLogix, SoftLogix platforms
22+
23+
### PLCopen XML (IEC 61131-3 TC6)
24+
- Siemens TIA Portal
25+
- CODESYS
26+
- Beckhoff TwinCAT
27+
- B&R Automation Studio
28+
- Beremiz
29+
- Any IEC 61131-3 compliant tool
30+
31+
## Installation
32+
33+
```bash
34+
cargo install --path .
35+
```
36+
37+
## Usage
38+
39+
```bash
40+
# Generate structure graph (default)
41+
plcviz project.L5X > structure.svg
42+
plcviz project.xml > structure.svg # PLCopen
43+
44+
# Generate call graph
45+
plcviz -t call project.L5X > calls.svg
46+
47+
# Generate combined graph (structure + calls)
48+
plcviz -t combined project.L5X > combined.svg
49+
50+
# DataType dependency graph (PLCopen only)
51+
plcviz -t dataflow project.xml > datatypes.svg
52+
53+
# Include AOIs in the graph (L5X only)
54+
plcviz -a project.L5X > with_aois.svg
55+
56+
# Generate example graph (no file needed)
57+
plcviz example > example.svg
58+
```
59+
60+
## Graph Types
61+
62+
| Type | L5X Support | PLCopen Support | Description |
63+
|------|------------|-----------------|-------------|
64+
| `structure` ||| Containment hierarchy (Programs/POUs) |
65+
| `call` ||| Function/FB call relationships |
66+
| `dataflow` | ⚠️ (example) || Tag relationships / DataType dependencies |
67+
| `combined` ||| Structure + call edges |
68+
69+
## Supported Export Types
70+
71+
### L5X
72+
- **Controller**: Full project exports (multiple programs)
73+
- **Program**: Single program exports
74+
- **AddOnInstructionDefinition**: AOI exports with internal routines
75+
76+
### PLCopen
77+
- **Project**: Full project with POUs (programs, functions, function blocks)
78+
- **DataTypes**: User-defined types and structures
79+
80+
## Format Detection
81+
82+
plcviz automatically detects the file format:
83+
- PLCopen: Detected by `<project xmlns="http://www.plcopen.org/xml/tc6...">`
84+
- L5X: All other XML files
85+
86+
## License
87+
88+
MIT

release/plcviz

6.92 MB
Binary file not shown.

0 commit comments

Comments
 (0)