From e444a41b458d379a45b756c0c52f84057815ee6d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:21:27 +0000 Subject: [PATCH 1/3] Initial plan From b0ab196012cc9aadd972f4dd88fa8e200cfb2098 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:34:49 +0000 Subject: [PATCH 2/3] Fix preview label workflow issue Co-authored-by: matt-goldman <19944129+matt-goldman@users.noreply.github.com> --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a91db33..c45ae90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,14 +53,19 @@ jobs: echo "BUMP=patch" >> $GITHUB_ENV fi - # Set NORELEASE as output of this step - echo "NORELEASE=${{ env.NORELEASE }}" >> $GITHUB_ENV + # Set NORELEASE + if [[ "$LABELS" == *"norelease"* ]]; then + echo "NORELEASE=true" >> $GITHUB_ENV + else + echo "NORELEASE=false" >> $GITHUB_ENV + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: GitHub Tag Bump id: tag_bump + if: env.NORELEASE != 'true' uses: anothrNick/github-tag-action@1.73.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -71,7 +76,7 @@ jobs: outputs: new_version: ${{ steps.tag_bump.outputs.new_tag }} - norelease: ${{ steps.tag_bump.outputs.norelease }} + norelease: ${{ env.NORELEASE }} publish-types: From cbae01be6e4619152d66b5228dce754867550e01 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:48:17 +0000 Subject: [PATCH 3/3] Fix preview label to properly create pre-release NuGet packages The root cause was that anothrNick/github-tag-action ignores the PRERELEASE environment variable when running on the default branch (main), always creating production releases instead of preview releases. This fix: - Conditionally uses the existing action only for release labels - Manually creates preview tags with -preview suffix when preview label is present - Maintains existing norelease functionality - Properly sets all environment variables and outputs Co-authored-by: matt-goldman <19944129+matt-goldman@users.noreply.github.com> --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c45ae90..21eb227 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,19 +63,61 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: GitHub Tag Bump - id: tag_bump - if: env.NORELEASE != 'true' + - name: GitHub Tag Bump (Release) + id: tag_bump_release + if: env.PRERELEASE == 'false' && env.NORELEASE != 'true' uses: anothrNick/github-tag-action@1.73.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} INITIAL_VERSION: 1.0.0 DEFAULT_BUMP: ${{ env.BUMP }} - PRERELEASE: ${{ env.PRERELEASE }} - PRERELEASE_SUFFIX: 'preview' + PRERELEASE: false + + - name: Get Latest Tag + id: get_latest_tag + if: env.PRERELEASE == 'true' && env.NORELEASE != 'true' + run: | + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "1.0.0") + echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT + + - name: Calculate Preview Version + id: calc_preview_version + if: env.PRERELEASE == 'true' && env.NORELEASE != 'true' + run: | + LATEST_TAG="${{ steps.get_latest_tag.outputs.latest_tag }}" + # Remove 'v' prefix if present + LATEST_TAG=${LATEST_TAG#v} + + # Split version into parts + IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_TAG" + + # Bump version based on BUMP type + if [[ "${{ env.BUMP }}" == "major" ]]; then + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + elif [[ "${{ env.BUMP }}" == "minor" ]]; then + MINOR=$((MINOR + 1)) + PATCH=0 + else + PATCH=$((PATCH + 1)) + fi + + # Create preview version + NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}-preview" + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + + - name: Create Preview Tag + id: tag_bump_preview + if: env.PRERELEASE == 'true' && env.NORELEASE != 'true' + run: | + NEW_VERSION="${{ steps.calc_preview_version.outputs.new_version }}" + git tag "$NEW_VERSION" + git push origin "$NEW_VERSION" + echo "new_tag=$NEW_VERSION" >> $GITHUB_OUTPUT outputs: - new_version: ${{ steps.tag_bump.outputs.new_tag }} + new_version: ${{ env.NORELEASE != 'true' && (steps.tag_bump_release.outputs.new_tag || steps.tag_bump_preview.outputs.new_tag) || '' }} norelease: ${{ env.NORELEASE }}