Jarida Release #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Jarida Release | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Bump version | |
| id: bump | |
| run: | | |
| python - <<'PY' | |
| import xml.etree.ElementTree as ET | |
| from pathlib import Path | |
| import os | |
| pom = Path("pom.xml") | |
| tree = ET.parse(pom) | |
| root = tree.getroot() | |
| ns = {"m": "http://maven.apache.org/POM/4.0.0"} | |
| version = root.find("m:version", ns) | |
| if version is None or not version.text: | |
| raise SystemExit("Version not found in pom.xml") | |
| parts = version.text.strip().split(".") | |
| if len(parts) != 3 or not all(p.isdigit() for p in parts): | |
| raise SystemExit(f"Unexpected version format: {version.text}") | |
| major, minor, patch = map(int, parts) | |
| patch += 1 | |
| new_version = f"{major}.{minor}.{patch}" | |
| version.text = new_version | |
| tree.write(pom, encoding="utf-8", xml_declaration=True) | |
| print(new_version) | |
| out = os.environ.get("GITHUB_OUTPUT") | |
| if out: | |
| with open(out, "a", encoding="utf-8") as f: | |
| f.write(f"version={new_version}\n") | |
| PY | |
| - name: Build | |
| run: mvn -DskipTests package | |
| - name: Commit version bump | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add pom.xml | |
| git commit -m "chore: bump version to ${{ steps.bump.outputs.version }}" || exit 0 | |
| git tag "v${{ steps.bump.outputs.version }}" | |
| git push origin HEAD --tags | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.bump.outputs.version }} | |
| name: Jarida v${{ steps.bump.outputs.version }} | |
| files: target/jarida-jadx-plugin-${{ steps.bump.outputs.version }}.jar |