|
| 1 | +name: Manual Release of tmv.h with Changelog |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'The version number for the new release (e.g., v0.1)' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + name: Create GitHub Release |
| 14 | + runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: write |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: Get latest release tag |
| 25 | + id: get_tag |
| 26 | + run: | |
| 27 | + latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "") |
| 28 | + echo "latest_tag=$latest_tag" >> "$GITHUB_OUTPUT" |
| 29 | +
|
| 30 | + - name: Get commit logs |
| 31 | + id: get_commits |
| 32 | + run: | |
| 33 | + if [ -z "${{ steps.get_tag.outputs.latest_tag }}" ]; then |
| 34 | + log_range="HEAD" |
| 35 | + echo "No previous tag found. All commits will be listed." |
| 36 | + else |
| 37 | + log_range="${{ steps.get_tag.outputs.latest_tag }}..HEAD" |
| 38 | + echo "Listing commits since tag ${{ steps.get_tag.outputs.latest_tag }}" |
| 39 | + fi |
| 40 | + |
| 41 | + commit_log=$(git log --pretty=format:'* %s (%h)' $log_range) |
| 42 | + |
| 43 | + echo "commits_body<<EOF" >> "$GITHUB_OUTPUT" |
| 44 | + echo "$commit_log" >> "$GITHUB_OUTPUT" |
| 45 | + echo "EOF" >> "$GITHUB_OUTPUT" |
| 46 | +
|
| 47 | + - name: Create Release |
| 48 | + id: create_release |
| 49 | + uses: actions/create-release@v1 |
| 50 | + env: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + with: |
| 53 | + tag_name: ${{ github.event.inputs.version }} |
| 54 | + release_name: "${{ github.event.inputs.version }}: tmv.h release" |
| 55 | + body: | |
| 56 | + # ${{ github.event.inputs.version }}: tmv - Squarified Treemap Viewer Release. |
| 57 | +
|
| 58 | + A C89 standard compliant, single header, nostdlib (no C Standard Library) Squarified Treemap Viewer (TMV). |
| 59 | +
|
| 60 | + --- |
| 61 | +
|
| 62 | + ### **Changes** |
| 63 | + |
| 64 | + ${{ steps.get_commits.outputs.commits_body }} |
| 65 | +
|
| 66 | + --- |
| 67 | +
|
| 68 | + ### What's Included |
| 69 | +
|
| 70 | + This release includes the `tmv.h` header file as well as testing and example codes ready to be used. |
| 71 | +
|
| 72 | + **Get started by downloading the source code today!** |
| 73 | +
|
| 74 | + draft: false |
| 75 | + prerelease: false |
0 commit comments