From 05d4f29d7e54348d91943bdaaca2c002901fca7a Mon Sep 17 00:00:00 2001 From: John Pusey Date: Wed, 1 May 2024 16:41:14 -0400 Subject: [PATCH] Add support for new `build_id` output (#4) --- CHANGELOG.md | 15 +++++++++++---- LICENSE | 2 +- README.md | 35 ++++++++++++++++++++--------------- action.yml | 16 ++++++++++++++-- 4 files changed, 46 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2a1ad0..4c4ce2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,17 @@ This project adheres to [Semantic Versioning]. ## [Unreleased] +## [2.0.0] - 2024-05-01 + +### Added + +- Add support for new `build_id` output. + ## [1.0.2] - 2023-03-17 ### Fixed -- Fixed erroneous quoting of `git_branch`, `git_commit`, and `variant_name` +- Fix erroneous quoting of `git_branch`, `git_commit`, and `variant_name` inputs. ## [1.0.1] - 2022-04-26 @@ -24,9 +30,10 @@ This project adheres to [Semantic Versioning]. Initial public release. -[Unreleased]: https://github.com/waldoapp/gh-action-upload/compare/v1.0.2...HEAD -[1.0.2]: https://github.com/waldoapp/gh-action-upload/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/waldoapp/gh-action-upload/compare/1.0.0...1.0.1 +[Unreleased]: https://github.com/waldoapp/gh-action-upload/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/waldoapp/gh-action-upload/compare/v1.0.2...v2.0.0 +[1.0.2]: https://github.com/waldoapp/gh-action-upload/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/waldoapp/gh-action-upload/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/waldoapp/gh-action-upload/compare/81e8b45...v1.0.0 [Keep a Changelog]: https://keepachangelog.com diff --git a/LICENSE b/LICENSE index ca2dea3..d69d7f0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -© 2022–2023 Amolo Atelier, Inc. +© 2022–2024 Amolo Atelier, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7b24727..b673415 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ workflow. Each application registered in Waldo is associated with a unique upload token. You can find the upload token for your app by going to the Documentation screen for your app in [Waldo](https://app.waldo.io/). This token _should_ be -specified as a _secret_ environment variable. +specified as a _secret_ environment variable. ## Inputs @@ -48,29 +48,34 @@ specified as a _secret_ environment variable. If this mode is enabled, additional debug information is printed. (Default: `false`.) +## Outputs + +- `build_id` + + A unique identifier for the build that you just uploaded. Empty if the upload + failed. + ## Usage ```yaml steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Build with Xcode + - name: Checkout repo + uses: actions/checkout@v4 + - name: Build app with Xcode run: | DERIVED_DATA_PATH=/tmp/YourApp-$(uuidgen) - xcodebuild -project YourApp.xcodeproj \ - -scheme YourApp \ - -configuration Release \ - -destination 'generic/platform=iOS Simulator' \ - -derivedDataPath "$DERIVED_DATA_PATH" \ - clean build + xcodebuild -project YourApp.xcodeproj \ + -scheme YourApp \ + -configuration Release \ + -sdk iphonesimulator \ + -derivedDataPath "$DERIVED_DATA_PATH" \ + build - echo "APP_DIR_PATH=${DERIVED_DATA_PATH}/Build/Products/Release-iphonesimulator/YourApp.app" >>$GITHUB_ENV - - name: Upload build to Waldo + echo "APP_DIR_PATH=${DERIVED_DATA_PATH}/Build/Products/Release-iphonesimulator/YourApp.app" >> "$GITHUB_ENV" + - name: Upload resulting build to Waldo uses: waldoapp/gh-action-upload@v1 with: build_path: ${{ env.APP_DIR_PATH }} - upload_token: ${{ secrets.WALDO_UPLOAD_TOKEN }} + upload_token: ${{ secrets.WALDO_CI_TOKEN }} ``` diff --git a/action.yml b/action.yml index 80d1e40..8ab739c 100644 --- a/action.yml +++ b/action.yml @@ -39,6 +39,12 @@ inputs: If this mode is enabled, additional debug information is printed. required: false default: false +outputs: + build_id: + description: > + A unique identifier for the build that you just uploaded. Empty if the + upload failed. + value: ${{ fromJSON(steps.metadata.outputs.json).appVersionID }} runs: using: composite steps: @@ -72,12 +78,18 @@ runs: extra_options="${extra_options} --verbose" fi - ${WALDO_CLI_BIN}/waldo upload "$build_path" --upload_token "$upload_token" ${extra_options} + ${WALDO_CLI_BIN}/waldo upload "$build_path" --upload_token "$upload_token" ${extra_options} | tee "$TMP_OUT" env: GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + TMP_OUT: ${{ runner.temp }}/upload.out WALDO_CLI_BIN: /usr/local/bin WALDO_WRAPPER_NAME_OVERRIDE: 'Waldo GitHub Action' - WALDO_WRAPPER_VERSION_OVERRIDE: 1.0.2 + WALDO_WRAPPER_VERSION_OVERRIDE: 2.0.0 + shell: bash + - run: echo "json=$(tail -n 1 "$TMP_OUT")" >> "$GITHUB_OUTPUT" + id: metadata + env: + TMP_OUT: ${{ runner.temp }}/upload.out shell: bash branding: icon: upload-cloud