Skip to content

Commit

Permalink
Add support for new build_id output (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
eBardX authored May 1, 2024
1 parent 2bf0ae8 commit 05d4f29
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 22 deletions.
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 }}
```
16 changes: 14 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 05d4f29

Please # to comment.