|
50 | 50 | with: |
51 | 51 | targets: ${{ matrix.target }} |
52 | 52 |
|
| 53 | + - uses: Swatinem/rust-cache@v2 |
| 54 | + with: |
| 55 | + workspaces: | |
| 56 | + css-inline |
| 57 | + bindings/java |
| 58 | +
|
53 | 59 | - name: Build native library |
54 | 60 | working-directory: bindings/java |
55 | 61 | run: cargo build --release --target ${{ matrix.target }} |
@@ -133,24 +139,17 @@ jobs: |
133 | 139 | import org.cssinline.CssInline; |
134 | 140 | public class Test { |
135 | 141 | public static void main(String[] args) { |
136 | | - try { |
137 | | - String html = "<html><head><style>h1{color:red}</style></head><body><h1>Test</h1></body></html>"; |
138 | | - String result = CssInline.inline(html); |
139 | | - if (!result.contains("style=\"color: red;\"")) { |
140 | | - System.err.println("Expected inlined style not found in: " + result); |
141 | | - System.exit(1); |
142 | | - } |
143 | | - System.out.println("✓ Integration test passed on ${{ matrix.platform }}"); |
144 | | - } catch (Exception e) { |
145 | | - System.err.println("Integration test failed: " + e.getMessage()); |
146 | | - e.printStackTrace(); |
147 | | - System.exit(1); |
| 142 | + String html = "<html><head><style>h1{color:red}</style></head><body><h1>Test</h1></body></html>"; |
| 143 | + String result = CssInline.inline(html); |
| 144 | + if (!result.contains("style=\"color: red;\"")) { |
| 145 | + throw new RuntimeException("Expected inlined style not found in: " + result); |
148 | 146 | } |
| 147 | + System.out.println("✓ Integration test passed on ${{ matrix.platform }}"); |
149 | 148 | } |
150 | 149 | } |
151 | 150 | EOF |
152 | 151 |
|
153 | | - JAR_FILE=$(ls css-inline-*-SNAPSHOT.jar | grep -v sources | grep -v javadoc) |
| 152 | + JAR_FILE=$(ls *.jar) |
154 | 153 |
|
155 | 154 | if [[ "$RUNNER_OS" == "Windows" ]]; then |
156 | 155 | CLASSPATH_SEP=";" |
@@ -182,24 +181,17 @@ jobs: |
182 | 181 | uses: actions/download-artifact@v4 |
183 | 182 | with: |
184 | 183 | name: java-jar |
185 | | - path: build/libs |
| 184 | + path: bindings/java/build/libs |
186 | 185 |
|
187 | 186 | - name: Extract version |
188 | 187 | run: echo "version=${GITHUB_REF#refs/tags/java-v}" >> $GITHUB_ENV |
189 | 188 |
|
190 | 189 | - name: Publish to GitHub Packages |
191 | 190 | working-directory: bindings/java |
192 | | - run: | |
193 | | - # Copy the pre-built JAR to the expected location |
194 | | - mkdir -p build/libs |
195 | | - cp ../../build/libs/*.jar build/libs/ |
196 | | -
|
197 | | - # Publish using the existing JAR |
198 | | - gradle publish -Pversion=${{ env.version }} |
| 191 | + run: gradle publish -Pversion=${{ env.version }} |
199 | 192 | env: |
200 | 193 | GITHUB_ACTOR: ${{ github.actor }} |
201 | 194 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
202 | | - VERSION: ${{ env.version }} |
203 | 195 |
|
204 | 196 | release: |
205 | 197 | name: Create GitHub Release |
|
0 commit comments