From 33dc907fca42111ba09fbc9a5a3c8b871e65acb8 Mon Sep 17 00:00:00 2001 From: "Gustavo P." Date: Tue, 3 Mar 2026 22:53:18 -0600 Subject: [PATCH 01/26] Create bump-version-from-tag.yml --- .github/workflows/bump-version-from-tag.yml | 77 +++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/bump-version-from-tag.yml diff --git a/.github/workflows/bump-version-from-tag.yml b/.github/workflows/bump-version-from-tag.yml new file mode 100644 index 00000000..66fb7da3 --- /dev/null +++ b/.github/workflows/bump-version-from-tag.yml @@ -0,0 +1,77 @@ +name: Bump version from tag + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + tag_name: + description: 'Tag name in format vX.Y.Z.W or vX.Y.Z.W-suffix' + required: true + type: string + +permissions: + contents: write + pull-requests: write + +jobs: + bump-version: + name: Update configure version and create PR + runs-on: ubuntu-latest + + steps: + - name: Checkout target branch + uses: actions/checkout@v4 + with: + ref: v2.4.8-windows-support + fetch-depth: 0 + + - name: Extract version from tag + id: extract + shell: bash + run: | + if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then + TAG_NAME="${{ inputs.tag_name }}" + else + TAG_NAME="${GITHUB_REF_NAME}" + fi + + if [[ "$TAG_NAME" =~ ^v([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(-.*)?$ ]]; then + VERSION="${BASH_REMATCH[1]}" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "Using version: $VERSION" + else + echo "Tag '$TAG_NAME' does not match expected format 'vX.Y.Z.W-...'." + exit 1 + fi + + - name: Update configure.ac + id: update + shell: bash + run: | + VERSION="${{ steps.extract.outputs.version }}" + + sed -Ei "s/^(AC_INIT\(\[LTFS\], \[)[^]]+(\], IBM corporation\.\))/\1${VERSION}\2/" configure.ac + + if git diff --quiet -- configure.ac; then + echo "changed=false" >> "$GITHUB_OUTPUT" + echo "No version change needed in configure.ac" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Create Pull Request + if: steps.update.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v6 + with: + base: v2.4.8-windows-support + branch: automation/bump-version-${{ steps.extract.outputs.version }} + delete-branch: true + commit-message: "chore: bump LTFS version to ${{ steps.extract.outputs.version }}" + title: "chore: bump LTFS version to ${{ steps.extract.outputs.version }}" + body: | + Automated version bump from tag `${{ github.ref_name }}`. + + - Parsed version: `${{ steps.extract.outputs.version }}` + - Updated file: `configure.ac` \ No newline at end of file From a412fc742a011894e8a92923ba91105765ce7097 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 11:42:29 -0800 Subject: [PATCH 02/26] Revert "Create bump-version-from-tag.yml" This reverts commit 33dc907fca42111ba09fbc9a5a3c8b871e65acb8. --- .github/workflows/bump-version-from-tag.yml | 77 --------------------- 1 file changed, 77 deletions(-) delete mode 100644 .github/workflows/bump-version-from-tag.yml diff --git a/.github/workflows/bump-version-from-tag.yml b/.github/workflows/bump-version-from-tag.yml deleted file mode 100644 index 66fb7da3..00000000 --- a/.github/workflows/bump-version-from-tag.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Bump version from tag - -on: - push: - tags: - - 'v*' - workflow_dispatch: - inputs: - tag_name: - description: 'Tag name in format vX.Y.Z.W or vX.Y.Z.W-suffix' - required: true - type: string - -permissions: - contents: write - pull-requests: write - -jobs: - bump-version: - name: Update configure version and create PR - runs-on: ubuntu-latest - - steps: - - name: Checkout target branch - uses: actions/checkout@v4 - with: - ref: v2.4.8-windows-support - fetch-depth: 0 - - - name: Extract version from tag - id: extract - shell: bash - run: | - if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then - TAG_NAME="${{ inputs.tag_name }}" - else - TAG_NAME="${GITHUB_REF_NAME}" - fi - - if [[ "$TAG_NAME" =~ ^v([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(-.*)?$ ]]; then - VERSION="${BASH_REMATCH[1]}" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - echo "Using version: $VERSION" - else - echo "Tag '$TAG_NAME' does not match expected format 'vX.Y.Z.W-...'." - exit 1 - fi - - - name: Update configure.ac - id: update - shell: bash - run: | - VERSION="${{ steps.extract.outputs.version }}" - - sed -Ei "s/^(AC_INIT\(\[LTFS\], \[)[^]]+(\], IBM corporation\.\))/\1${VERSION}\2/" configure.ac - - if git diff --quiet -- configure.ac; then - echo "changed=false" >> "$GITHUB_OUTPUT" - echo "No version change needed in configure.ac" - else - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - - name: Create Pull Request - if: steps.update.outputs.changed == 'true' - uses: peter-evans/create-pull-request@v6 - with: - base: v2.4.8-windows-support - branch: automation/bump-version-${{ steps.extract.outputs.version }} - delete-branch: true - commit-message: "chore: bump LTFS version to ${{ steps.extract.outputs.version }}" - title: "chore: bump LTFS version to ${{ steps.extract.outputs.version }}" - body: | - Automated version bump from tag `${{ github.ref_name }}`. - - - Parsed version: `${{ steps.extract.outputs.version }}` - - Updated file: `configure.ac` \ No newline at end of file From 5dd7a6d5e8302f7c88a2e9d45a1625ef4d9923fc Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 11:47:33 -0800 Subject: [PATCH 03/26] Create update-version.yml --- .github/workflows/update-version.yml | 99 ++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/update-version.yml diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 00000000..d9a14d80 --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,99 @@ +name: Update Version from Upstream + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run (show changes without committing)' + required: false + type: boolean + default: false + +jobs: + update-version: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Fetch latest tag from upstream + id: get_tag + run: | + # Fetch the latest tag from the upstream repository + LATEST_TAG=$(curl -s https://api.github.com/repos/LinearTapeFileSystem/ltfs/tags | jq -r '.[0].name') + echo "Latest tag from upstream: $LATEST_TAG" + + # Extract version numbers (e.g., v.2.4.8.2-10520 -> 2.4.8.2) + VERSION=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + echo "Extracted version: $VERSION" + + # Store in output + echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Update configure.ac + id: update_file + run: | + VERSION="${{ steps.get_tag.outputs.version }}" + + # Backup original file + cp configure.ac configure.ac.bak + + # Update line 39 with the new version + # This replaces the version number between the brackets on line 39 + sed -i "39s/\[LTFS\], \[[^]]*\]/[LTFS], [$VERSION]/" configure.ac + + # Check if file was modified + if diff -q configure.ac configure.ac.bak > /dev/null; then + echo "No changes needed - version is already up to date" + echo "changed=false" >> $GITHUB_OUTPUT + else + echo "File updated successfully" + echo "changed=true" >> $GITHUB_OUTPUT + + # Show the diff + echo "Changes made:" + diff -u configure.ac.bak configure.ac || true + fi + + # Clean up backup + rm configure.ac.bak + + - name: Show changes (dry run) + if: ${{ inputs.dry_run == true }} + run: | + echo "DRY RUN MODE - No changes will be committed" + echo "Upstream tag: ${{ steps.get_tag.outputs.tag }}" + echo "Extracted version: ${{ steps.get_tag.outputs.version }}" + git diff configure.ac + + - name: Commit and push changes + if: ${{ inputs.dry_run == false && steps.update_file.outputs.changed == 'true' }} + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + git add configure.ac + git commit -m "Update version to ${{ steps.get_tag.outputs.version }} from upstream tag ${{ steps.get_tag.outputs.tag }}" + git push + + - name: Summary + run: | + echo "## Version Update Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- **Upstream Tag**: ${{ steps.get_tag.outputs.tag }}" >> $GITHUB_STEP_SUMMARY + echo "- **Extracted Version**: ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "- **File Changed**: ${{ steps.update_file.outputs.changed }}" >> $GITHUB_STEP_SUMMARY + echo "- **Dry Run**: ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY + + if [ "${{ steps.update_file.outputs.changed }}" == "true" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Updated Line 39" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sed -n '39p' configure.ac >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + fi + From 91cd0b2709fcb41a128ad3cd7552ccb302b4c70f Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 11:51:55 -0800 Subject: [PATCH 04/26] Update update-version.yml --- .github/workflows/update-version.yml | 82 +++++++++++++--------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index d9a14d80..152bf285 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -1,13 +1,10 @@ name: Update Version from Upstream on: + push: + branches: + - '**' workflow_dispatch: - inputs: - dry_run: - description: 'Dry run (show changes without committing)' - required: false - type: boolean - default: false jobs: update-version: @@ -18,6 +15,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Fetch latest tag from upstream id: get_tag @@ -34,44 +32,42 @@ jobs: echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Check current version in configure.ac + id: check_version + run: | + # Extract current version from line 39 + CURRENT_VERSION=$(sed -n '39p' configure.ac | sed -E 's/.*\[LTFS\], \[([^]]+)\].*/\1/') + echo "Current version in configure.ac: $CURRENT_VERSION" + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + + # Compare with upstream version + UPSTREAM_VERSION="${{ steps.get_tag.outputs.version }}" + + if [ "$CURRENT_VERSION" == "$UPSTREAM_VERSION" ]; then + echo "Version is up to date - no action needed" + echo "needs_update=false" >> $GITHUB_OUTPUT + else + echo "Version mismatch detected!" + echo " Current: $CURRENT_VERSION" + echo " Upstream: $UPSTREAM_VERSION" + echo "needs_update=true" >> $GITHUB_OUTPUT + fi + - name: Update configure.ac + if: steps.check_version.outputs.needs_update == 'true' id: update_file run: | VERSION="${{ steps.get_tag.outputs.version }}" - # Backup original file - cp configure.ac configure.ac.bak - # Update line 39 with the new version - # This replaces the version number between the brackets on line 39 sed -i "39s/\[LTFS\], \[[^]]*\]/[LTFS], [$VERSION]/" configure.ac - # Check if file was modified - if diff -q configure.ac configure.ac.bak > /dev/null; then - echo "No changes needed - version is already up to date" - echo "changed=false" >> $GITHUB_OUTPUT - else - echo "File updated successfully" - echo "changed=true" >> $GITHUB_OUTPUT - - # Show the diff - echo "Changes made:" - diff -u configure.ac.bak configure.ac || true - fi - - # Clean up backup - rm configure.ac.bak - - - name: Show changes (dry run) - if: ${{ inputs.dry_run == true }} - run: | - echo "DRY RUN MODE - No changes will be committed" - echo "Upstream tag: ${{ steps.get_tag.outputs.tag }}" - echo "Extracted version: ${{ steps.get_tag.outputs.version }}" - git diff configure.ac + echo "File updated successfully" + echo "Updated line 39:" + sed -n '39p' configure.ac - name: Commit and push changes - if: ${{ inputs.dry_run == false && steps.update_file.outputs.changed == 'true' }} + if: steps.check_version.outputs.needs_update == 'true' run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" @@ -82,18 +78,18 @@ jobs: - name: Summary run: | - echo "## Version Update Summary" >> $GITHUB_STEP_SUMMARY + echo "## Version Check Summary" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "- **Upstream Tag**: ${{ steps.get_tag.outputs.tag }}" >> $GITHUB_STEP_SUMMARY - echo "- **Extracted Version**: ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "- **File Changed**: ${{ steps.update_file.outputs.changed }}" >> $GITHUB_STEP_SUMMARY - echo "- **Dry Run**: ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY + echo "- **Upstream Version**: ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "- **Current Version**: ${{ steps.check_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY + echo "- **Update Needed**: ${{ steps.check_version.outputs.needs_update }}" >> $GITHUB_STEP_SUMMARY - if [ "${{ steps.update_file.outputs.changed }}" == "true" ]; then + if [ "${{ steps.check_version.outputs.needs_update }}" == "true" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Version updated and committed** from ${{ steps.check_version.outputs.current_version }} to ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY + else echo "" >> $GITHUB_STEP_SUMMARY - echo "### Updated Line 39" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - sed -n '39p' configure.ac >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY + echo "**No action needed** - version is already up to date" >> $GITHUB_STEP_SUMMARY fi From c9ae68cbb73a62875726b907b96e84945a339360 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Mar 2026 19:52:09 +0000 Subject: [PATCH 05/26] Update version to 2.4.8.2 from upstream tag v2.4.8.2-10520 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f28d2b28..5b906c68 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.5.1 (Prelim)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.2], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From 6547b622807ca5158f79e67ff7489b528b083a98 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 11:54:15 -0800 Subject: [PATCH 06/26] Change name and commit test --- .github/workflows/update-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 152bf285..98819fb9 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -1,4 +1,4 @@ -name: Update Version from Upstream +name: Update Version on configure from Upstream on: push: From 3bf8ad79cb556e9e72536e2ee9dc28d0e82ed425 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 11:59:47 -0800 Subject: [PATCH 07/26] Revert "Update version to 2.4.8.2 from upstream tag v2.4.8.2-10520" This reverts commit c9ae68cbb73a62875726b907b96e84945a339360. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5b906c68..f28d2b28 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.2], IBM corporation.) +AC_INIT([LTFS], [2.4.5.1 (Prelim)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From dd356781b4822ef9b7dbe0d9b5defb92d1883795 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 11:59:53 -0800 Subject: [PATCH 08/26] Update update-version.yml --- .github/workflows/update-version.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 98819fb9..a043ab9b 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -1,9 +1,8 @@ name: Update Version on configure from Upstream on: - push: - branches: - - '**' + pull_request: + types: [opened, synchronize, reopened] workflow_dispatch: jobs: From 69fb111ebc0fe1b44debb444856c4b6c1e274642 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 12:02:19 -0800 Subject: [PATCH 09/26] Update update-version.yml --- .github/workflows/update-version.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index a043ab9b..6dcfc618 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -13,6 +13,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} @@ -73,7 +75,7 @@ jobs: git add configure.ac git commit -m "Update version to ${{ steps.get_tag.outputs.version }} from upstream tag ${{ steps.get_tag.outputs.tag }}" - git push + git push origin HEAD:${{ github.event.pull_request.head.ref }} - name: Summary run: | From 3bf638e001be9381a8cca1fa997891614a96ac76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Mar 2026 20:02:35 +0000 Subject: [PATCH 10/26] Update version to 2.4.8.2 from upstream tag v2.4.8.2-10520 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f28d2b28..5b906c68 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.5.1 (Prelim)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.2], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From 07989bce338d6d016fed4edcb1a2b68ed6a644cd Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 12:05:21 -0800 Subject: [PATCH 11/26] Updated name --- .github/workflows/update-version.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 6dcfc618..4ba534ef 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -1,4 +1,4 @@ -name: Update Version on configure from Upstream +name: Sync LTFS Version with Upstream on: pull_request: @@ -74,7 +74,7 @@ jobs: git config --local user.name "github-actions[bot]" git add configure.ac - git commit -m "Update version to ${{ steps.get_tag.outputs.version }} from upstream tag ${{ steps.get_tag.outputs.tag }}" + git commit -m "chore: sync configure.ac version to ${{ steps.get_tag.outputs.version }} (upstream: ${{ steps.get_tag.outputs.tag }})" git push origin HEAD:${{ github.event.pull_request.head.ref }} - name: Summary @@ -88,9 +88,9 @@ jobs: if [ "${{ steps.check_version.outputs.needs_update }}" == "true" ]; then echo "" >> $GITHUB_STEP_SUMMARY - echo "**Version updated and committed** from ${{ steps.check_version.outputs.current_version }} to ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "**configure.ac synced** - Version updated from ${{ steps.check_version.outputs.current_version }} to ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY else echo "" >> $GITHUB_STEP_SUMMARY - echo "**No action needed** - version is already up to date" >> $GITHUB_STEP_SUMMARY + echo "**No sync needed** - configure.ac version already matches upstream (${{ steps.get_tag.outputs.version }})" >> $GITHUB_STEP_SUMMARY fi From f6d300ac95b1630a577c8e02259e5c531d2df58e Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 12:23:55 -0800 Subject: [PATCH 12/26] Extract build num too --- .github/workflows/update-version.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 4ba534ef..8e124571 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -25,8 +25,17 @@ jobs: LATEST_TAG=$(curl -s https://api.github.com/repos/LinearTapeFileSystem/ltfs/tags | jq -r '.[0].name') echo "Latest tag from upstream: $LATEST_TAG" - # Extract version numbers (e.g., v.2.4.8.2-10520 -> 2.4.8.2) - VERSION=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + # Extract version numbers and build number (e.g., v.2.4.8.2-10520 -> 2.4.8.2 (10520)) + VERSION_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + BUILD_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-([0-9]+).*/\1/') + + # Combine version with build number + if [ -n "$BUILD_NUM" ] && [ "$BUILD_NUM" != "$LATEST_TAG" ]; then + VERSION="$VERSION_NUM ($BUILD_NUM)" + else + VERSION="$VERSION_NUM" + fi + echo "Extracted version: $VERSION" # Store in output From ada5cc23f11421268a47bc4864bc8be76f2ca998 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Mar 2026 20:24:17 +0000 Subject: [PATCH 13/26] chore: sync configure.ac version to 2.4.8.2 (10520) (upstream: v2.4.8.2-10520) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5b906c68..bbd72421 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.2], IBM corporation.) +AC_INIT([LTFS], [2.4.8.2 (10520)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From ab19f88627758295ae88c99cea0fa9e5760b15e7 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 12:38:51 -0800 Subject: [PATCH 14/26] Update update-version.yml --- .github/workflows/update-version.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 8e124571..09da44c9 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -5,6 +5,10 @@ on: types: [opened, synchronize, reopened] workflow_dispatch: +permissions: + contents: write + pull-requests: write + jobs: update-version: runs-on: ubuntu-latest @@ -50,8 +54,9 @@ jobs: echo "Current version in configure.ac: $CURRENT_VERSION" echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - # Compare with upstream version + # Get upstream version (already includes build number) UPSTREAM_VERSION="${{ steps.get_tag.outputs.version }}" + echo "Upstream version: $UPSTREAM_VERSION" if [ "$CURRENT_VERSION" == "$UPSTREAM_VERSION" ]; then echo "Version is up to date - no action needed" From 3b577f4596a065d0eee4b68d3ca8b9237ce3ae2c Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Wed, 4 Mar 2026 12:40:17 -0800 Subject: [PATCH 15/26] Update configure.ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bbd72421..d35aab32 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.2 (10520)], IBM corporation.) +AC_INIT([LTFS], [2.4.5.1 (Test)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From f8b23b37cac564de20e479e2586e64f61bd13906 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Mar 2026 20:40:31 +0000 Subject: [PATCH 16/26] chore: sync configure.ac version to 2.4.8.2 (10520) (upstream: v2.4.8.2-10520) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d35aab32..bbd72421 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.5.1 (Test)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.2 (10520)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From fb5d1583a56357f95d84b3d8cf180af575b03149 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 07:52:44 -0800 Subject: [PATCH 17/26] New apporach --- .github/workflows/update-version.yml | 110 ------------------- .github/workflows/version-bump-prelim.yml | 126 ++++++++++++++++++++++ 2 files changed, 126 insertions(+), 110 deletions(-) delete mode 100644 .github/workflows/update-version.yml create mode 100644 .github/workflows/version-bump-prelim.yml diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml deleted file mode 100644 index 09da44c9..00000000 --- a/.github/workflows/update-version.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Sync LTFS Version with Upstream - -on: - pull_request: - types: [opened, synchronize, reopened] - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - update-version: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Fetch latest tag from upstream - id: get_tag - run: | - # Fetch the latest tag from the upstream repository - LATEST_TAG=$(curl -s https://api.github.com/repos/LinearTapeFileSystem/ltfs/tags | jq -r '.[0].name') - echo "Latest tag from upstream: $LATEST_TAG" - - # Extract version numbers and build number (e.g., v.2.4.8.2-10520 -> 2.4.8.2 (10520)) - VERSION_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') - BUILD_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-([0-9]+).*/\1/') - - # Combine version with build number - if [ -n "$BUILD_NUM" ] && [ "$BUILD_NUM" != "$LATEST_TAG" ]; then - VERSION="$VERSION_NUM ($BUILD_NUM)" - else - VERSION="$VERSION_NUM" - fi - - echo "Extracted version: $VERSION" - - # Store in output - echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Check current version in configure.ac - id: check_version - run: | - # Extract current version from line 39 - CURRENT_VERSION=$(sed -n '39p' configure.ac | sed -E 's/.*\[LTFS\], \[([^]]+)\].*/\1/') - echo "Current version in configure.ac: $CURRENT_VERSION" - echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - - # Get upstream version (already includes build number) - UPSTREAM_VERSION="${{ steps.get_tag.outputs.version }}" - echo "Upstream version: $UPSTREAM_VERSION" - - if [ "$CURRENT_VERSION" == "$UPSTREAM_VERSION" ]; then - echo "Version is up to date - no action needed" - echo "needs_update=false" >> $GITHUB_OUTPUT - else - echo "Version mismatch detected!" - echo " Current: $CURRENT_VERSION" - echo " Upstream: $UPSTREAM_VERSION" - echo "needs_update=true" >> $GITHUB_OUTPUT - fi - - - name: Update configure.ac - if: steps.check_version.outputs.needs_update == 'true' - id: update_file - run: | - VERSION="${{ steps.get_tag.outputs.version }}" - - # Update line 39 with the new version - sed -i "39s/\[LTFS\], \[[^]]*\]/[LTFS], [$VERSION]/" configure.ac - - echo "File updated successfully" - echo "Updated line 39:" - sed -n '39p' configure.ac - - - name: Commit and push changes - if: steps.check_version.outputs.needs_update == 'true' - run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - - git add configure.ac - git commit -m "chore: sync configure.ac version to ${{ steps.get_tag.outputs.version }} (upstream: ${{ steps.get_tag.outputs.tag }})" - git push origin HEAD:${{ github.event.pull_request.head.ref }} - - - name: Summary - run: | - echo "## Version Check Summary" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "- **Upstream Tag**: ${{ steps.get_tag.outputs.tag }}" >> $GITHUB_STEP_SUMMARY - echo "- **Upstream Version**: ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "- **Current Version**: ${{ steps.check_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY - echo "- **Update Needed**: ${{ steps.check_version.outputs.needs_update }}" >> $GITHUB_STEP_SUMMARY - - if [ "${{ steps.check_version.outputs.needs_update }}" == "true" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "**configure.ac synced** - Version updated from ${{ steps.check_version.outputs.current_version }} to ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY - else - echo "" >> $GITHUB_STEP_SUMMARY - echo "**No sync needed** - configure.ac version already matches upstream (${{ steps.get_tag.outputs.version }})" >> $GITHUB_STEP_SUMMARY - fi - diff --git a/.github/workflows/version-bump-prelim.yml b/.github/workflows/version-bump-prelim.yml new file mode 100644 index 00000000..0b3293f7 --- /dev/null +++ b/.github/workflows/version-bump-prelim.yml @@ -0,0 +1,126 @@ +name: Version Bump - Prelim + +on: + push: + tags: + - 'v.*' + - 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+-[0-9]+' + +permissions: + contents: write + pull-requests: write + +jobs: + bump-version-prelim: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: v2.4.8-windows-support + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check current version and process + id: process_version + run: | + # Get the tag that triggered this workflow + TAG_NAME="${GITHUB_REF#refs/tags/}" + echo "Tag created: $TAG_NAME" + + # Extract current version from configure.ac line 39 + CURRENT_VERSION=$(sed -n '39p' configure.ac | sed -E 's/.*\[LTFS\], \[([^]]+)\].*/\1/') + echo "Current version in configure.ac: $CURRENT_VERSION" + + # Check if current version already contains "(Prelim)" + if [[ "$CURRENT_VERSION" == *"(Prelim)"* ]]; then + echo "Current version already has (Prelim) - no action needed" + echo "needs_update=false" >> $GITHUB_OUTPUT + exit 0 + fi + + # If we reach here, we need to update + echo "needs_update=true" >> $GITHUB_OUTPUT + + # Extract version numbers from tag (e.g., v.2.4.8.2-10520 -> 2.4.8.2) + VERSION_NUM=$(echo "$TAG_NAME" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + echo "Extracted version from tag: $VERSION_NUM" + + # Split version into parts + IFS='.' read -r -a VERSION_PARTS <<< "$VERSION_NUM" + MAJOR="${VERSION_PARTS[0]}" + MINOR="${VERSION_PARTS[1]}" + PATCH="${VERSION_PARTS[2]}" + BUILD="${VERSION_PARTS[3]}" + + # Increment the last number (build) + NEW_BUILD=$((BUILD + 1)) + NEW_VERSION="$MAJOR.$MINOR.$PATCH.$NEW_BUILD" + + echo "New version: $NEW_VERSION" + + # Create version with Prelim label + FINAL_VERSION="$NEW_VERSION (Prelim)" + echo "Final version string: $FINAL_VERSION" + + # Store in output + echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT + echo "version=$FINAL_VERSION" >> $GITHUB_OUTPUT + echo "version_num=$NEW_VERSION" >> $GITHUB_OUTPUT + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + + - name: Update configure.ac + if: steps.process_version.outputs.needs_update == 'true' + id: update_file + run: | + VERSION="${{ steps.process_version.outputs.version }}" + + # Update line 39 with the new version + sed -i "39s/\[LTFS\], \[[^]]*\]/[LTFS], [$VERSION]/" configure.ac + + echo "File updated successfully" + echo "Updated line 39:" + sed -n '39p' configure.ac + + - name: Create Pull Request + if: steps.process_version.outputs.needs_update == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: bump version to ${{ steps.process_version.outputs.version }}" + branch: version-bump-prelim-${{ steps.process_version.outputs.version_num }} + base: v2.4.8-windows-support + title: "Version Bump: ${{ steps.process_version.outputs.version }}" + body: | + ## Version Bump - Prelim + + This PR was automatically created after tag creation to update the version for the next development cycle. + + - **Created Tag**: ${{ steps.process_version.outputs.tag }} + - **Previous Version**: ${{ steps.process_version.outputs.current_version }} + - **New Version**: ${{ steps.process_version.outputs.version }} + + ### Changes + - Updated configure.ac line 39 with new version + - Version label: Prelim (preliminary/development) + + This PR prepares the repository for the next development iteration. + labels: prelim, version-bump, automated + + - name: Summary + run: | + echo "## Version Bump Summary - Prelim" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- **Triggered by Tag**: ${{ steps.process_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY + echo "- **Current Version**: ${{ steps.process_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY + + if [ "${{ steps.process_version.outputs.needs_update }}" == "true" ]; then + echo "- **New Version**: ${{ steps.process_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "- **Target Branch**: v2.4.8-windows-support" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Pull Request Created** - Automatically created for next development cycle." >> $GITHUB_STEP_SUMMARY + else + echo "" >> $GITHUB_STEP_SUMMARY + echo "**No Action Taken** - Version already has (Prelim) label." >> $GITHUB_STEP_SUMMARY + fi From 46a1405d4f744f88300d728315840f1a6e1e892b Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 07:58:24 -0800 Subject: [PATCH 18/26] Update version-bump-prelim.yml --- .github/workflows/version-bump-prelim.yml | 89 ++++++++++++----------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/.github/workflows/version-bump-prelim.yml b/.github/workflows/version-bump-prelim.yml index 0b3293f7..1b556f1d 100644 --- a/.github/workflows/version-bump-prelim.yml +++ b/.github/workflows/version-bump-prelim.yml @@ -2,9 +2,8 @@ name: Version Bump - Prelim on: push: - tags: - - 'v.*' - - 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+-[0-9]+' + branches: + - v2.4.8-windows-support permissions: contents: write @@ -18,16 +17,35 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - ref: v2.4.8-windows-support fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - - name: Check current version and process + - name: Check commit message + id: check_commit + run: | + # Get the commit message that triggered this workflow + COMMIT_MSG="${{ github.event.head_commit.message }}" + echo "Commit message: $COMMIT_MSG" + + # Check if commit message contains "release-tag" + if [[ "$COMMIT_MSG" == *"release-tag"* ]]; then + echo "Commit contains 'release-tag' - skipping workflow" + echo "should_run=false" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "should_run=true" >> $GITHUB_OUTPUT + + - name: Fetch latest tag and process version + if: steps.check_commit.outputs.should_run == 'true' id: process_version run: | - # Get the tag that triggered this workflow - TAG_NAME="${GITHUB_REF#refs/tags/}" - echo "Tag created: $TAG_NAME" + # Fetch all tags + git fetch --tags + + # Get the latest tag + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v.2.4.8.0-0") + echo "Latest tag: $LATEST_TAG" # Extract current version from configure.ac line 39 CURRENT_VERSION=$(sed -n '39p' configure.ac | sed -E 's/.*\[LTFS\], \[([^]]+)\].*/\1/') @@ -40,11 +58,8 @@ jobs: exit 0 fi - # If we reach here, we need to update - echo "needs_update=true" >> $GITHUB_OUTPUT - # Extract version numbers from tag (e.g., v.2.4.8.2-10520 -> 2.4.8.2) - VERSION_NUM=$(echo "$TAG_NAME" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + VERSION_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') echo "Extracted version from tag: $VERSION_NUM" # Split version into parts @@ -65,14 +80,14 @@ jobs: echo "Final version string: $FINAL_VERSION" # Store in output - echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT + echo "needs_update=true" >> $GITHUB_OUTPUT + echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT echo "version=$FINAL_VERSION" >> $GITHUB_OUTPUT echo "version_num=$NEW_VERSION" >> $GITHUB_OUTPUT echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - name: Update configure.ac - if: steps.process_version.outputs.needs_update == 'true' - id: update_file + if: steps.check_commit.outputs.should_run == 'true' && steps.process_version.outputs.needs_update == 'true' run: | VERSION="${{ steps.process_version.outputs.version }}" @@ -83,44 +98,32 @@ jobs: echo "Updated line 39:" sed -n '39p' configure.ac - - name: Create Pull Request - if: steps.process_version.outputs.needs_update == 'true' - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "chore: bump version to ${{ steps.process_version.outputs.version }}" - branch: version-bump-prelim-${{ steps.process_version.outputs.version_num }} - base: v2.4.8-windows-support - title: "Version Bump: ${{ steps.process_version.outputs.version }}" - body: | - ## Version Bump - Prelim - - This PR was automatically created after tag creation to update the version for the next development cycle. - - - **Created Tag**: ${{ steps.process_version.outputs.tag }} - - **Previous Version**: ${{ steps.process_version.outputs.current_version }} - - **New Version**: ${{ steps.process_version.outputs.version }} - - ### Changes - - Updated configure.ac line 39 with new version - - Version label: Prelim (preliminary/development) - - This PR prepares the repository for the next development iteration. - labels: prelim, version-bump, automated + - name: Commit and push changes + if: steps.check_commit.outputs.should_run == 'true' && steps.process_version.outputs.needs_update == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + git add configure.ac + git commit -m "chore: bump version to ${{ steps.process_version.outputs.version }}" + git push - name: Summary + if: steps.check_commit.outputs.should_run == 'true' run: | echo "## Version Bump Summary - Prelim" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "- **Triggered by Tag**: ${{ steps.process_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY - echo "- **Current Version**: ${{ steps.process_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY if [ "${{ steps.process_version.outputs.needs_update }}" == "true" ]; then + echo "- **Latest Tag**: ${{ steps.process_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY + echo "- **Previous Version**: ${{ steps.process_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY echo "- **New Version**: ${{ steps.process_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "- **Target Branch**: v2.4.8-windows-support" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Pull Request Created** - Automatically created for next development cycle." >> $GITHUB_STEP_SUMMARY + echo "**Version Updated** - Committed to v2.4.8-windows-support branch." >> $GITHUB_STEP_SUMMARY else + echo "- **Current Version**: ${{ steps.process_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**No Action Taken** - Version already has (Prelim) label." >> $GITHUB_STEP_SUMMARY fi + +# Made with Bob From 6862bd9070e45d85627893cd9e1fc0510029b37d Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 08:07:34 -0800 Subject: [PATCH 19/26] Re-doing --- .github/workflows/update-version.yml | 133 +++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 .github/workflows/update-version.yml diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 00000000..71c274c4 --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,133 @@ +name: Sync LTFS Version with Upstream + +on: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + update-version: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Fetch latest tag from upstream + id: get_tag + run: | + # Fetch the latest tag from the upstream repository + LATEST_TAG=$(curl -s https://api.github.com/repos/LinearTapeFileSystem/ltfs/tags | jq -r '.[0].name') + echo "Latest tag from upstream: $LATEST_TAG" + + # Extract version numbers and build number (e.g., v.2.4.8.2-10520 -> 2.4.8.2 (10520)) + VERSION_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + BUILD_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-([0-9]+).*/\1/') + + # Combine version with build number + if [ -n "$BUILD_NUM" ] && [ "$BUILD_NUM" != "$LATEST_TAG" ]; then + VERSION="$VERSION_NUM ($BUILD_NUM)" + else + VERSION="$VERSION_NUM" + fi + + echo "Extracted version: $VERSION" + + # Store in output + echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Check current version in configure.ac + id: check_version + run: | + # Extract current version from line 39 + CURRENT_VERSION=$(sed -n '39p' configure.ac | sed -E 's/.*\[LTFS\], \[([^]]+)\].*/\1/') + echo "Current version in configure.ac: $CURRENT_VERSION" + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + + # Check if commit message contains "release-tag" + COMMIT_MSG=$(git log -1 --pretty=%B) + echo "Latest commit message: $COMMIT_MSG" + + if echo "$COMMIT_MSG" | grep -q "release-tag"; then + echo "Commit contains 'release-tag' keyword - skipping update" + echo "needs_update=false" >> $GITHUB_OUTPUT + exit 0 + fi + + # Extract the value inside parentheses from current version + PAREN_VALUE=$(echo "$CURRENT_VERSION" | sed -E 's/.*\(([^)]+)\).*/\1/') + echo "Value in parentheses: $PAREN_VALUE" + + # Check if the value in parentheses is a number + if ! echo "$PAREN_VALUE" | grep -qE '^[0-9]+$'; then + echo "Value in parentheses is not a number (likely 'Prelim') - no update needed" + echo "needs_update=false" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "Value in parentheses is a number - proceeding with update" + + # Extract version number without parentheses (e.g., "2.4.8.2" from "2.4.8.2 (10520)") + VERSION_BASE=$(echo "$CURRENT_VERSION" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') + echo "Base version: $VERSION_BASE" + + # Increment the last number in the version + LAST_NUM=$(echo "$VERSION_BASE" | awk -F. '{print $NF}') + NEW_LAST_NUM=$((LAST_NUM + 1)) + NEW_VERSION=$(echo "$VERSION_BASE" | sed -E "s/\.[0-9]+$/.$NEW_LAST_NUM/") + NEW_VERSION_WITH_PRELIM="$NEW_VERSION (Prelim)" + + echo "New version: $NEW_VERSION_WITH_PRELIM" + echo "new_version=$NEW_VERSION_WITH_PRELIM" >> $GITHUB_OUTPUT + echo "needs_update=true" >> $GITHUB_OUTPUT + + - name: Update configure.ac + if: steps.check_version.outputs.needs_update == 'true' + id: update_file + run: | + VERSION="${{ steps.check_version.outputs.new_version }}" + + # Update line 39 with the new version + sed -i "39s/\[LTFS\], \[[^]]*\]/[LTFS], [$VERSION]/" configure.ac + + echo "File updated successfully" + echo "Updated line 39:" + sed -n '39p' configure.ac + + - name: Commit and push changes + if: steps.check_version.outputs.needs_update == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + git add configure.ac + git commit -m "chore: update version to ${{ steps.check_version.outputs.new_version }}" + git push origin HEAD:${{ github.event.pull_request.head.ref }} + + - name: Summary + run: | + echo "## Version Check Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- **Upstream Tag**: ${{ steps.get_tag.outputs.tag }}" >> $GITHUB_STEP_SUMMARY + echo "- **Upstream Version**: ${{ steps.get_tag.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "- **Current Version**: ${{ steps.check_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY + echo "- **Update Needed**: ${{ steps.check_version.outputs.needs_update }}" >> $GITHUB_STEP_SUMMARY + + if [ "${{ steps.check_version.outputs.needs_update }}" == "true" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "**configure.ac updated** - Version changed from ${{ steps.check_version.outputs.current_version }} to ${{ steps.check_version.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY + else + echo "" >> $GITHUB_STEP_SUMMARY + echo "**No update needed** - Version already has 'Prelim' or commit contains 'release-tag'" >> $GITHUB_STEP_SUMMARY + fi + From fde1a5abcb15b9e813dd39216df1d172c27408ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Mar 2026 16:07:49 +0000 Subject: [PATCH 20/26] chore: update version to 2.4.8.3 (Prelim) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bbd72421..fe2c16b5 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.2 (10520)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.3 (Prelim)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From b28ecece530933607e3e7bb66ed60d88537257bb Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 08:07:49 -0800 Subject: [PATCH 21/26] Delete version-bump-prelim.yml --- .github/workflows/version-bump-prelim.yml | 129 ---------------------- 1 file changed, 129 deletions(-) delete mode 100644 .github/workflows/version-bump-prelim.yml diff --git a/.github/workflows/version-bump-prelim.yml b/.github/workflows/version-bump-prelim.yml deleted file mode 100644 index 1b556f1d..00000000 --- a/.github/workflows/version-bump-prelim.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Version Bump - Prelim - -on: - push: - branches: - - v2.4.8-windows-support - -permissions: - contents: write - pull-requests: write - -jobs: - bump-version-prelim: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Check commit message - id: check_commit - run: | - # Get the commit message that triggered this workflow - COMMIT_MSG="${{ github.event.head_commit.message }}" - echo "Commit message: $COMMIT_MSG" - - # Check if commit message contains "release-tag" - if [[ "$COMMIT_MSG" == *"release-tag"* ]]; then - echo "Commit contains 'release-tag' - skipping workflow" - echo "should_run=false" >> $GITHUB_OUTPUT - exit 0 - fi - - echo "should_run=true" >> $GITHUB_OUTPUT - - - name: Fetch latest tag and process version - if: steps.check_commit.outputs.should_run == 'true' - id: process_version - run: | - # Fetch all tags - git fetch --tags - - # Get the latest tag - LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v.2.4.8.0-0") - echo "Latest tag: $LATEST_TAG" - - # Extract current version from configure.ac line 39 - CURRENT_VERSION=$(sed -n '39p' configure.ac | sed -E 's/.*\[LTFS\], \[([^]]+)\].*/\1/') - echo "Current version in configure.ac: $CURRENT_VERSION" - - # Check if current version already contains "(Prelim)" - if [[ "$CURRENT_VERSION" == *"(Prelim)"* ]]; then - echo "Current version already has (Prelim) - no action needed" - echo "needs_update=false" >> $GITHUB_OUTPUT - exit 0 - fi - - # Extract version numbers from tag (e.g., v.2.4.8.2-10520 -> 2.4.8.2) - VERSION_NUM=$(echo "$LATEST_TAG" | sed -E 's/^v\.?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/') - echo "Extracted version from tag: $VERSION_NUM" - - # Split version into parts - IFS='.' read -r -a VERSION_PARTS <<< "$VERSION_NUM" - MAJOR="${VERSION_PARTS[0]}" - MINOR="${VERSION_PARTS[1]}" - PATCH="${VERSION_PARTS[2]}" - BUILD="${VERSION_PARTS[3]}" - - # Increment the last number (build) - NEW_BUILD=$((BUILD + 1)) - NEW_VERSION="$MAJOR.$MINOR.$PATCH.$NEW_BUILD" - - echo "New version: $NEW_VERSION" - - # Create version with Prelim label - FINAL_VERSION="$NEW_VERSION (Prelim)" - echo "Final version string: $FINAL_VERSION" - - # Store in output - echo "needs_update=true" >> $GITHUB_OUTPUT - echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT - echo "version=$FINAL_VERSION" >> $GITHUB_OUTPUT - echo "version_num=$NEW_VERSION" >> $GITHUB_OUTPUT - echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - - - name: Update configure.ac - if: steps.check_commit.outputs.should_run == 'true' && steps.process_version.outputs.needs_update == 'true' - run: | - VERSION="${{ steps.process_version.outputs.version }}" - - # Update line 39 with the new version - sed -i "39s/\[LTFS\], \[[^]]*\]/[LTFS], [$VERSION]/" configure.ac - - echo "File updated successfully" - echo "Updated line 39:" - sed -n '39p' configure.ac - - - name: Commit and push changes - if: steps.check_commit.outputs.should_run == 'true' && steps.process_version.outputs.needs_update == 'true' - run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - - git add configure.ac - git commit -m "chore: bump version to ${{ steps.process_version.outputs.version }}" - git push - - - name: Summary - if: steps.check_commit.outputs.should_run == 'true' - run: | - echo "## Version Bump Summary - Prelim" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - if [ "${{ steps.process_version.outputs.needs_update }}" == "true" ]; then - echo "- **Latest Tag**: ${{ steps.process_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY - echo "- **Previous Version**: ${{ steps.process_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY - echo "- **New Version**: ${{ steps.process_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Version Updated** - Committed to v2.4.8-windows-support branch." >> $GITHUB_STEP_SUMMARY - else - echo "- **Current Version**: ${{ steps.process_version.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**No Action Taken** - Version already has (Prelim) label." >> $GITHUB_STEP_SUMMARY - fi - -# Made with Bob From 9c14d831b0509b9847323f44e7dc1a2e9a7cdbd9 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 08:09:23 -0800 Subject: [PATCH 22/26] release-tag --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fe2c16b5..de697512 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.3 (Prelim)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.3 (11111)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From fe94a8d7fd8f00ee74ff15a629153d701efc77b4 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 08:11:10 -0800 Subject: [PATCH 23/26] Test, this should trigger to change to prelim automatically --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index de697512..1f0e0202 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.3 (11111)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.3 (11112)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From 3f29aba3bdc4562f4b1c365a7c79e2d1ac858752 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Mar 2026 16:11:26 +0000 Subject: [PATCH 24/26] chore: update version to 2.4.8.4 (Prelim) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1f0e0202..b0407eb7 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.3 (11112)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.4 (Prelim)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From 07232fe1ff9e06a2c4bb75603ca0d07d24561445 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Thu, 5 Mar 2026 08:13:28 -0800 Subject: [PATCH 25/26] Test, no change because already prelim --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b0407eb7..fe2c16b5 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.4 (Prelim)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.3 (Prelim)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4]) From 2de313d11b473eb5571051c43da319342ba78228 Mon Sep 17 00:00:00 2001 From: "Gustavo P." <47061318+Piloalucard@users.noreply.github.com> Date: Fri, 6 Mar 2026 15:49:19 -0600 Subject: [PATCH 26/26] release-tag --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fe2c16b5..bbd72421 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ dnl dnl LTFS configure.ac. dnl -AC_INIT([LTFS], [2.4.8.3 (Prelim)], IBM corporation.) +AC_INIT([LTFS], [2.4.8.2 (10520)], IBM corporation.) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIRS([m4])