VisuStruct 1.2.0 #17
Workflow file for this run
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
| # When you publish a new GitHub Release, this workflow builds the JAR and uploads it to that release. | |
| name: Release — build JAR and attach | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: write | |
| jobs: | |
| attach-jar: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set release body from release-notes (if file exists for tag) | |
| env: | |
| RELEASE_URL: ${{ github.event.release.url }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| FILE="release-notes/${TAG_NAME}.md" | |
| if [[ ! -f "$FILE" ]]; then | |
| echo "No $FILE — leaving release description unchanged." | |
| exit 0 | |
| fi | |
| BODY=$(jq -n --rawfile body "$FILE" '{body: $body}') | |
| curl -sS -f -X PATCH \ | |
| -H "Authorization: Bearer $GH_TOKEN" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "$RELEASE_URL" \ | |
| -d "$BODY" | |
| echo "Release description set from $FILE." | |
| - name: Make mvnw executable | |
| run: chmod +x mvnw | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: temurin | |
| cache: maven | |
| - name: Build JAR | |
| run: ./mvnw -B clean package -DskipTests | |
| - name: Copy stable filename (for “latest” download link) | |
| run: | | |
| set -e | |
| jar=$(ls target/visustruct-*.jar | head -1) | |
| cp "$jar" visustruct.jar | |
| - name: Upload assets to published release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| target/visustruct-*.jar | |
| visustruct.jar |