metanorma-plugin-plantuml 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b3797ddb4db236753261836d74b360e635c58ea3b0eeaa09dfc1c7192dacf78
4
- data.tar.gz: 0aba3ecbbc90f15570887ea206fa0a0c19b6d3179a7d9481438fb480df305873
3
+ metadata.gz: 93f98be4977dfd92a2a7b7d33a74d1f27bb9f93eb5a55116da04f64650c0a126
4
+ data.tar.gz: cfd9bf9c6d5f3e781047481784fcd7350a69ff87a86148cf41a60edf1ef16cdf
5
5
  SHA512:
6
- metadata.gz: ed86eced1c2c434f17ce4f3f5307c88f349c30275ad2051ea7c6063feb1d13ca6c64480ea406951221a75ceececd035ffed82519d9dfe169205f55a160996c9b
7
- data.tar.gz: 2e1488a69e6c3ff71a88c17778fead0b264ed2b6c8d2a7d8803e04441d0d7f1b4b2cebdd102050e6428500a477a876d6f3cc8cdf9882da007a7bc6900a19cffa
6
+ metadata.gz: 3a9cbefb6348ff7aacee1c9a2dae7ce0373bd1e015b2b0de184674f9440740e4f04b3a3cf50e7ebf4814b98c10ef0cf91df160974166e6ea04ddf730f8a79888
7
+ data.tar.gz: fdf26284b53c231dcb4cdafed24c400c18d7c323ad7f4c4506219cfa89395d818072d93c67a8714500ce906b426b583a1b4c2c8579dd6ed5f595c6b52753a1fa
@@ -8,7 +8,7 @@ on:
8
8
  # Allow manual triggering
9
9
 
10
10
  jobs:
11
- check-plantuml-version:
11
+ update-plantuml:
12
12
  runs-on: ubuntu-latest
13
13
 
14
14
  steps:
@@ -23,91 +23,73 @@ jobs:
23
23
  ruby-version: '3.1'
24
24
  bundler-cache: true
25
25
 
26
- - name: Get current PlantUML version
27
- id: current-version
26
+ - name: Check for PlantUML updates
27
+ id: update
28
28
  run: |
29
- CURRENT_VERSION=$(ruby -e "require './lib/metanorma/plugin/plantuml/version'; puts Metanorma::Plugin::Plantuml::PLANTUML_JAR_VERSION")
30
- echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
31
-
32
- - name: Get latest PlantUML release
33
- id: latest-version
34
- run: |
35
- LATEST_VERSION=$(curl -s https://api.github.com/repos/plantuml/plantuml/releases/latest | jq -r .tag_name | sed 's/^v//')
36
- echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
37
-
38
- - name: Compare versions
39
- id: compare
40
- run: |
41
- if [ "${{ steps.current-version.outputs.version }}" != "${{ steps.latest-version.outputs.version }}" ]; then
42
- echo "needs_update=true" >> $GITHUB_OUTPUT
43
- echo "Current version: ${{ steps.current-version.outputs.version }}"
44
- echo "Latest version: ${{ steps.latest-version.outputs.version }}"
29
+ # Run the update task and capture exit code
30
+ if rake update_plantuml; then
31
+ echo "update_made=false" >> $GITHUB_OUTPUT
32
+ echo "No update needed - PlantUML is up to date"
45
33
  else
46
- echo "needs_update=false" >> $GITHUB_OUTPUT
47
- echo "PlantUML version is up to date"
48
- fi
49
-
50
- - name: Update version file
51
- if: steps.compare.outputs.needs_update == 'true'
52
- run: |
53
- NEW_VERSION="${{ steps.latest-version.outputs.version }}"
54
- sed -i "s/PLANTUML_JAR_VERSION = \".*\"/PLANTUML_JAR_VERSION = \"$NEW_VERSION\"/" lib/metanorma/plugin/plantuml/version.rb
34
+ EXIT_CODE=$?
35
+ if [ $EXIT_CODE -eq 1 ]; then
36
+ echo "update_made=true" >> $GITHUB_OUTPUT
37
+ echo "Update completed successfully"
55
38
 
56
- - name: Update gem version
57
- if: steps.compare.outputs.needs_update == 'true'
58
- run: |
59
- # Increment patch version using semantic versioning
60
- CURRENT_GEM_VERSION=$(ruby -e "require './lib/metanorma/plugin/plantuml/version'; puts Metanorma::Plugin::Plantuml::VERSION")
61
- NEW_GEM_VERSION=$(ruby -e "
62
- require 'rubygems'
63
- current_version = Gem::Version.new('$CURRENT_GEM_VERSION')
64
- segments = current_version.segments
65
- segments[2] = (segments[2] || 0) + 1
66
- puts segments.join('.')
67
- ")
68
- sed -i "s/VERSION = \".*\"/VERSION = \"$NEW_GEM_VERSION\"/" lib/metanorma/plugin/plantuml/version.rb
69
- echo "Updated gem version from $CURRENT_GEM_VERSION to $NEW_GEM_VERSION"
39
+ # Get version info for PR
40
+ PLANTUML_VERSION=$(ruby -e "load 'lib/metanorma/plugin/plantuml/version.rb'; puts Metanorma::Plugin::Plantuml::PLANTUML_JAR_VERSION")
41
+ GEM_VERSION=$(ruby -e "load 'lib/metanorma/plugin/plantuml/version.rb'; puts Metanorma::Plugin::Plantuml::VERSION")
70
42
 
71
- - name: Remove old JAR and download new one
72
- if: steps.compare.outputs.needs_update == 'true'
73
- run: |
74
- rm -f data/plantuml.jar
75
- bundle exec rake download_jar
76
-
77
- - name: Verify new JAR works
78
- if: steps.compare.outputs.needs_update == 'true'
79
- run: |
80
- if [ -f "data/plantuml.jar" ]; then
81
- echo "PlantUML JAR downloaded successfully"
82
- java -jar data/plantuml.jar -version || echo "Version check completed"
83
- else
84
- echo "Failed to download PlantUML JAR"
85
- exit 1
43
+ echo "plantuml_version=$PLANTUML_VERSION" >> $GITHUB_OUTPUT
44
+ echo "gem_version=$GEM_VERSION" >> $GITHUB_OUTPUT
45
+ else
46
+ echo "❌ Update failed with exit code $EXIT_CODE"
47
+ exit $EXIT_CODE
48
+ fi
86
49
  fi
50
+ env:
51
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87
52
 
88
53
  - name: Create Pull Request
89
- if: steps.compare.outputs.needs_update == 'true'
54
+ if: steps.update.outputs.update_made == 'true'
90
55
  uses: peter-evans/create-pull-request@v5
91
56
  with:
92
57
  token: ${{ secrets.GITHUB_TOKEN }}
93
58
  commit-message: |
94
- Update PlantUML to version ${{ steps.latest-version.outputs.version }}
59
+ Update PlantUML to version ${{ steps.update.outputs.plantuml_version }}
95
60
 
96
- - Updated PLANTUML_JAR_VERSION to ${{ steps.latest-version.outputs.version }}
97
- - Downloaded new PlantUML JAR file
98
- - Incremented gem version
99
- title: "Update PlantUML to version ${{ steps.latest-version.outputs.version }}"
61
+ - Updated PLANTUML_JAR_VERSION to ${{ steps.update.outputs.plantuml_version }}
62
+ - Downloaded and verified new PlantUML JAR file
63
+ - Incremented gem version to ${{ steps.update.outputs.gem_version }}
64
+
65
+ Generated by automated PlantUML update workflow
66
+ title: "Update PlantUML to version ${{ steps.update.outputs.plantuml_version }}"
100
67
  body: |
101
- This PR updates PlantUML to the latest version ${{ steps.latest-version.outputs.version }}.
68
+ This PR updates PlantUML to the latest version **${{ steps.update.outputs.plantuml_version }}**.
69
+
70
+ ## Changes Made
71
+ - ✅ Updated `PLANTUML_JAR_VERSION` to `${{ steps.update.outputs.plantuml_version }}`
72
+ - ✅ Downloaded and verified new PlantUML JAR file
73
+ - ✅ Incremented gem version to `${{ steps.update.outputs.gem_version }}`
74
+ - ✅ Validated JAR functionality with version check and diagram generation
75
+
76
+ ## Automated Validation
77
+ - [x] Found latest valid PlantUML release (excludes pre-releases and native builds)
78
+ - [x] Confirmed semantic version is newer than current
79
+ - [x] JAR file downloads successfully
80
+ - [x] JAR executes and shows correct version
81
+ - [x] JAR can generate test diagrams
102
82
 
103
- Changes:
104
- - Updated `PLANTUML_JAR_VERSION` in `lib/metanorma/plugin/plantuml/version.rb`
105
- - Downloaded new PlantUML JAR to `data/plantuml.jar`
106
- - Incremented gem version
83
+ ---
84
+ *This update was created automatically by the PlantUML version sync workflow using `rake update_plantuml`.*
107
85
 
108
- This update was created automatically by the PlantUML version sync workflow.
109
- branch: update-plantuml-${{ steps.latest-version.outputs.version }}
86
+ To update PlantUML manually, run:
87
+ ```bash
88
+ rake update_plantuml
89
+ ```
90
+ branch: update-plantuml-${{ steps.update.outputs.plantuml_version }}
110
91
  base: main
111
92
  labels: |
112
93
  enhancement
113
94
  automated
95
+ plantuml-update
@@ -10,6 +10,9 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- uses: metanorma/ci/.github/workflows/plantuml-rake.yml@main
13
+ uses: metanorma/ci/.github/workflows/generic-rake.yml@main
14
14
  secrets:
15
15
  pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
16
+ with:
17
+ before-setup-ruby: |
18
+ java -version
data/Gemfile CHANGED
@@ -18,6 +18,7 @@ gem "debug"
18
18
  gem "metanorma"
19
19
  gem "metanorma-standoc", github: "metanorma/metanorma-standoc",
20
20
  branch: "main"
21
+ gem "octokit"
21
22
  gem "rake"
22
23
  gem "rspec"
23
24
  gem "rspec-html-matchers"