diff --git a/.github/workflows/changelog_release.yaml b/.github/workflows/changelog_release.yaml new file mode 100644 index 000000000..1b35854b1 --- /dev/null +++ b/.github/workflows/changelog_release.yaml @@ -0,0 +1,75 @@ +name: Auto Release on Changelog Update + +on: + push: + branches: [ main ] + paths: + - 'CHANGELOG.md' + +jobs: + prepare-release: + name: Extract version & check tag + runs-on: ubuntu-latest + outputs: + version: ${{ steps.extract.outputs.version }} + should_release: ${{ steps.tagcheck.outputs.should_release }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # need tags + + - name: Extract version from CHANGELOG.md + id: extract + run: | + second_h2_line=$(grep -E '^## \[' CHANGELOG.md | sed -n '2p') || true + if [ -z "$second_h2_line" ]; then + echo "Could not find second H2 header in CHANGELOG.md" >&2 + exit 1 + fi + # Support optional prerelease (-rc.1, -beta, etc) and build metadata (+build.5) per SemVer, no leading 'v'. + version=$(echo "$second_h2_line" | sed -E 's/^## \[([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)\].*/\1/') + if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then + echo "Parsed version '$version' is not a valid SEMVER" >&2 + exit 1 + fi + echo "version=$version" >> "$GITHUB_OUTPUT" + echo "Extracted version: $version" + + - name: Check if tag already exists + id: tagcheck + run: | + version_tag="v${{ steps.extract.outputs.version }}" + if git ls-remote --exit-code --tags origin "$version_tag" >/dev/null 2>&1; then + echo "Tag $version_tag already exists. Skipping release." >&2 + echo "should_release=false" >> "$GITHUB_OUTPUT" + else + echo "Tag $version_tag does not exist. Will release." >&2 + echo "should_release=true" >> "$GITHUB_OUTPUT" + fi + - name: Emit skip notice + if: steps.tagcheck.outputs.should_release == 'false' + run: | + echo "::notice title=Release skipped::Tag v${{ steps.extract.outputs.version }} already exists. No release will be created." + + run-release: + name: Run Release workflow + needs: prepare-release + if: needs.prepare-release.outputs.should_release == 'true' + permissions: + id-token: write + contents: write + uses: ./.github/workflows/update_sdk_version.yaml + with: + version: ${{ needs.prepare-release.outputs.version }} + emergency: false + + no-release: + name: No release (tag exists) + needs: prepare-release + if: needs.prepare-release.outputs.should_release == 'false' + runs-on: ubuntu-latest + steps: + - name: Summary + run: | + echo "Tag v${{ needs.prepare-release.outputs.version }} already exists. Release workflow not invoked." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release_gh.yaml b/.github/workflows/release_gh.yaml index f02a1bb95..e0a881f56 100644 --- a/.github/workflows/release_gh.yaml +++ b/.github/workflows/release_gh.yaml @@ -146,6 +146,15 @@ jobs: -f sha="${sha}" \ -f branch="main" + # Use CHANGELOG.md in root + # prerelease: true extracts the content between the first (## [Unreleased]) + # and second H2 header, + - name: Extract release notes + id: extract-release-notes + uses: ffurrer2/extract-release-notes@v2 + with: + prerelease: true + # Upload artifacts to the newly created release. # Prefix release version with "v". - name: Create release @@ -153,7 +162,7 @@ jobs: ls -R gh release create "v$VERSION" \ --target "$GITHUB_REF_NAME" \ - --generate-notes \ + --notes '${{ steps.extract-release-notes.outputs.release_notes }}' \ "Capture-$VERSION.ios.zip" \ "Capture-$VERSION.doccarchive.ios.zip" \ "Capture-$VERSION.android.zip" \ diff --git a/.github/workflows/update_sdk_version.yaml b/.github/workflows/update_sdk_version.yaml index ddceae078..6581b7a3d 100644 --- a/.github/workflows/update_sdk_version.yaml +++ b/.github/workflows/update_sdk_version.yaml @@ -11,6 +11,16 @@ on: type: boolean description: Ignore main branch requirement (SOC2 compliance) required: true + workflow_call: + inputs: + version: + description: 'The new version to release, ex: 0.12.0' + required: true + type: string + emergency: + type: boolean + description: Ignore main branch requirement (SOC2 compliance)' + required: true jobs: gh-release: permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..19e5282fa --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,76 @@ +# Change Log + +## [Unreleased] +[Unreleased]: https://github.com/bitdriftlabs/capture-sdk/compare/v0.19.0...HEAD + +### Both + +**Added** + +- Add API to clear all feature flags. + +**Changed** + +- Nothing yet! + +**Fixed** + +- Add back the ability to disable the Session Replay feature at SDK initialization. + +### Android + +**Added** + +- Nothing yet! + +**Changed** + +- Nothing yet! + +**Fixed** + +- Nothing yet! + +### iOS + +**Added** + +- Nothing yet! + +**Changed** + +- Nothing yet! + +**Fixed** + +- Nothing yet! + +## [0.19.0] - 2025-10-27 +[0.19.0]: https://github.com/bitdriftlabs/capture-sdk/releases/tag/v0.19.0 + +### Both + +**Added** + +- Add support for free-tier bitdrift plans. + +**Fixed** + +- Improve performance of Feature Flags writes. + +### Android + +**Added** + +- Add ANR detection for "App Start ANR". + +**Fixed** + +- Improve detection for "Service ANR" for when a Service takes too long to start. +- Fix inaccurate frame symbolication in some NDK crash stacktraces. + +### iOS + +**Fixed** + +- Improve performance of Uptime clock computations which should improve the performance all across the SDK.