From 62dc272aed279057c3da36cedad873d880592979 Mon Sep 17 00:00:00 2001 From: Richard Elms Date: Mon, 3 Feb 2025 16:25:34 +0100 Subject: [PATCH 1/8] bump unity cli ref on release (#170) --- .github/workflows/downstream_updates.yml | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/downstream_updates.yml diff --git a/.github/workflows/downstream_updates.yml b/.github/workflows/downstream_updates.yml new file mode 100644 index 00000000..93101b3d --- /dev/null +++ b/.github/workflows/downstream_updates.yml @@ -0,0 +1,37 @@ +name: downstream-updates +permissions: read-all + +on: + release: + types: [released] + workflow_dispatch: + inputs: + target_version: + description: 'Version of the CLI to update downstream repos to' + required: true + type: string + +jobs: + update-dependencies: + runs-on: ubuntu-latest + env: + RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.target_version || github.event.release.tag_name }} + strategy: + matrix: + downstream_repo: ['bugsnag/bugsnag-unity'] + steps: + - name: Install libcurl4-openssl-dev and net-tools + run: | + sudo apt-get update + sudo apt-get install libcurl4-openssl-dev net-tools + + - run: > + curl -X POST https://api.github.com/repos/bugsnag/bugsnag-unity/dispatches + -H 'Content-Type: application/json' + -H "Authorization: Bearer ${{ secrets.DEP_UPDATER_BEARER_TOKEN }}" + -d '{ + "event_type": "update-cli", + "client_payload": { + "cli_version": "${{ env.RELEASE_VERSION }}" + } + }' \ No newline at end of file From f44833d051b19e955e8e7b2f8cc0cc29b5ed200d Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Mon, 10 Feb 2025 09:56:50 +0000 Subject: [PATCH 2/8] get NDK version from the properties file --- CHANGELOG.md | 5 ++++ pkg/android/get-ndk-version.go | 43 +++++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e179de..ea30898b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## TBD + +### Fixes +- Get NDK version from the `source.properties` file when uploading NDK symbol files + ## 2.9.1 - (2025-01-23) ### Fixes diff --git a/pkg/android/get-ndk-version.go b/pkg/android/get-ndk-version.go index d81988e2..d3c4bb2e 100644 --- a/pkg/android/get-ndk-version.go +++ b/pkg/android/get-ndk-version.go @@ -1,21 +1,52 @@ package android import ( + "bufio" + "fmt" + "os" "path/filepath" "strconv" "strings" ) // GetNdkVersion - Returns the major NDK version -func GetNdkVersion(path string) (int, error) { +func GetNdkVersion(ndkPath string) (int, error) { + // Construct the path to source.properties + sourceFile := filepath.Join(ndkPath, "source.properties") - ndkVersion := strings.Split(filepath.Base(path), ".") + // Open the file + file, err := os.Open(sourceFile) + if err != nil { + return 0, fmt.Errorf("failed to open source.properties: %v", err) + } + defer file.Close() - ndkIntVersion, err := strconv.Atoi(ndkVersion[0]) + // Read the file line by line + scanner := bufio.NewScanner(file) + for scanner.Scan() { + line := scanner.Text() + if strings.HasPrefix(line, "Pkg.Revision") { + // Extract version string + parts := strings.Split(line, " = ") + if len(parts) == 2 { + versionStr := parts[1] + // Extract major version (before the first dot) + versionParts := strings.Split(versionStr, ".") + if len(versionParts) > 0 { + majorVersion, err := strconv.Atoi(versionParts[0]) + if err != nil { + return 0, fmt.Errorf("failed to parse major version: %v", err) + } + return majorVersion, nil + } + } + } + } - if err != nil { - return 0, err + // Check for errors while scanning + if err := scanner.Err(); err != nil { + return 0, fmt.Errorf("error reading source.properties: %v", err) } - return ndkIntVersion, nil + return 0, fmt.Errorf("NDK version not found in source.properties") } From 9e6bd8163f5413f43d8c7234f29800c6acc5b935 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Mon, 10 Feb 2025 09:57:50 +0000 Subject: [PATCH 3/8] update PR link in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea30898b..4871a373 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## TBD ### Fixes -- Get NDK version from the `source.properties` file when uploading NDK symbol files +- Get NDK version from the `source.properties` file when uploading NDK symbol files [172](https://github.com/bugsnag/bugsnag-cli/pull/172) ## 2.9.1 - (2025-01-23) From 5757c8fe959e295ab52887c4688e4bf35c7050ef Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Mon, 10 Feb 2025 12:02:38 +0000 Subject: [PATCH 4/8] get NDK version from the properties file --- pkg/android/get-ndk-version.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/android/get-ndk-version.go b/pkg/android/get-ndk-version.go index d3c4bb2e..a663c919 100644 --- a/pkg/android/get-ndk-version.go +++ b/pkg/android/get-ndk-version.go @@ -27,7 +27,8 @@ func GetNdkVersion(ndkPath string) (int, error) { line := scanner.Text() if strings.HasPrefix(line, "Pkg.Revision") { // Extract version string - parts := strings.Split(line, " = ") + parts := strings.Split(line, "=") + parts[1] = strings.TrimSpace(parts[1]) if len(parts) == 2 { versionStr := parts[1] // Extract major version (before the first dot) From 80ca1a15e9ddb12bc99e548f1c56465d0c4783f9 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 11 Feb 2025 11:58:25 +0000 Subject: [PATCH 5/8] bump version --- CHANGELOG.md | 2 +- install.sh | 2 +- main.go | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4871a373..7dc59965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## TBD +## 2.10.0 (2025-02-11) ### Fixes - Get NDK version from the `source.properties` file when uploading NDK symbol files [172](https://github.com/bugsnag/bugsnag-cli/pull/172) diff --git a/install.sh b/install.sh index 5e3be392..7c321bb3 100755 --- a/install.sh +++ b/install.sh @@ -91,7 +91,7 @@ display_help() { EOS } -VERSION="2.9.1" +VERSION="2.10.0" while [[ "$#" -gt 0 ]]; do case "$1" in diff --git a/main.go b/main.go index c3e46d5d..806fb579 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "github.com/bugsnag/bugsnag-cli/pkg/utils" ) -var package_version = "2.9.1" +var package_version = "2.10.0" func main() { commands := options.CLI{} diff --git a/package.json b/package.json index 86b1a085..4ee3c377 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bugsnag/cli", - "version": "2.9.1", + "version": "2.10.0", "description": "BugSnag CLI", "main": "bugsnag-cli-wrapper.js", "bin": { From a17ee5d2e8be1dbc7026346f4ffd59279b49f0ca Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 11 Feb 2025 12:15:10 +0000 Subject: [PATCH 6/8] update unity android tests --- features/Unity-Android/unity.feature | 15 +++++++++++++++ features/steps/steps.rb | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/features/Unity-Android/unity.feature b/features/Unity-Android/unity.feature index 807dc230..571d5492 100644 --- a/features/Unity-Android/unity.feature +++ b/features/Unity-Android/unity.feature @@ -13,6 +13,21 @@ Feature: Unity Android integration tests And the sourcemap payload field "versionName" equals "1.0" And the sourcemap payload field "overwrite" equals "true" + Scenario: Unity Android integration tests using the bundled NDK + Given I build the Unity Android example project + And I wait for the Unity symbols to generate + + Given I set the NDK path to the Unity bundled version + When I run bugsnag-cli with upload unity-android --upload-api-root-url=http://localhost:9339 --api-key=1234567890ABCDEF1234567890ABCDEF--overwrite platforms-examples/Unity/ + Then I wait to receive 5 sourcemaps + Then the sourcemap is valid for the Android Build API + Then the sourcemaps Content-Type header is valid multipart form-data + And the sourcemap payload field "apiKey" equals "1234567890ABCDEF1234567890ABCDEF" + And the sourcemap payload field "appId" equals "com.bugsnag.example.unity.android" + And the sourcemap payload field "versionCode" equals "1" + And the sourcemap payload field "versionName" equals "1.0" + And the sourcemap payload field "overwrite" equals "true" + Scenario: Unity Android integration tests passing the aab file Given I build the Unity Android example project diff --git a/features/steps/steps.rb b/features/steps/steps.rb index 6307f5e5..a02a48f3 100644 --- a/features/steps/steps.rb +++ b/features/steps/steps.rb @@ -230,3 +230,8 @@ def get_version_number(file_path) And('I wait for the Unity symbols to generate') do Maze.check.include(`ls #{@fixture_dir}`, 'UnityExample-1.0-v1-IL2CPP.symbols.zip') end + +Given(/^I set the NDK path to the Unity bundled version$/) do +# Set the environment variable to the path of the NDK bundled with Unity + ENV['ANDROID_NDK_ROOT'] = "/Applications/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}/PlaybackEngines/AndroidPlayer/NDK" +end From e78210e074b5760f7dab6242af7ea3820e99ce5c Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 11 Feb 2025 12:24:20 +0000 Subject: [PATCH 7/8] update unity android tests --- features/Unity-Android/unity.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/Unity-Android/unity.feature b/features/Unity-Android/unity.feature index 571d5492..17c50384 100644 --- a/features/Unity-Android/unity.feature +++ b/features/Unity-Android/unity.feature @@ -18,7 +18,7 @@ Feature: Unity Android integration tests And I wait for the Unity symbols to generate Given I set the NDK path to the Unity bundled version - When I run bugsnag-cli with upload unity-android --upload-api-root-url=http://localhost:9339 --api-key=1234567890ABCDEF1234567890ABCDEF--overwrite platforms-examples/Unity/ + When I run bugsnag-cli with upload unity-android --upload-api-root-url=http://localhost:9339 --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite platforms-examples/Unity/ Then I wait to receive 5 sourcemaps Then the sourcemap is valid for the Android Build API Then the sourcemaps Content-Type header is valid multipart form-data From 0611d5486aaecc905bd952c902c465463308928b Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 11 Feb 2025 13:41:29 +0000 Subject: [PATCH 8/8] bump version --- CHANGELOG.md | 2 +- install.sh | 2 +- main.go | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dc59965..fbea375a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2.10.0 (2025-02-11) +## 2.9.2 (2025-02-11) ### Fixes - Get NDK version from the `source.properties` file when uploading NDK symbol files [172](https://github.com/bugsnag/bugsnag-cli/pull/172) diff --git a/install.sh b/install.sh index 7c321bb3..93c3376c 100755 --- a/install.sh +++ b/install.sh @@ -91,7 +91,7 @@ display_help() { EOS } -VERSION="2.10.0" +VERSION="2.9.2" while [[ "$#" -gt 0 ]]; do case "$1" in diff --git a/main.go b/main.go index 806fb579..c665e76a 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "github.com/bugsnag/bugsnag-cli/pkg/utils" ) -var package_version = "2.10.0" +var package_version = "2.9.2" func main() { commands := options.CLI{} diff --git a/package.json b/package.json index 4ee3c377..8402ca4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bugsnag/cli", - "version": "2.10.0", + "version": "2.9.2", "description": "BugSnag CLI", "main": "bugsnag-cli-wrapper.js", "bin": {