To integrate Shorebird into your CI, use the setup-shorebird action. The
setup-shorebird action downloads Shorebird and adds it to the system path.
name: Shorebird Workflow Exampleon: workflow_dispatch:jobs: example: defaults: run: shell: bash runs-on: ubuntu-latest steps: # Use the setup-shorebird action to configure Shorebird - name: 🐦 Setup Shorebird uses: shorebirdtech/setup-shorebird@v1 with: cache: true # Optionally cache your Shorebird installation # Now we're able to use Shorebird CLI in our workflow - name: 🚀 Use Shorebird run: shorebird --version
In the above workflow, we’re using the setup-shorebird action to configure
Shorebird in our CI and in subsequent steps we can execute any Shorebird
commands.
Most Shorebird functionality, like creating releases and patches, requires being
authenticated. In order to authenticate with Shorebird in CI, you will need to
generate a CI token.
shorebird login:ci
You will be prompted to go through a similar OAuth Flow as when using
shorebird login, however, shorebird login:ci will not store any credentials
on your device. Instead, it will output a base-64 encoded auth token that you
will use in your CI environment.
The output of this command should look something like:
$ shorebird login:ciThe Shorebird CLI needs your authorization to manage apps, releases, and patches on your behalf.In a browser, visit this URL to log in:https://accounts.google.com/o/oauth2/v2/auth...Waiting for your authorization...🎉 Success! Use the following token to login on a CI server:qwerasdf1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqwer1234asdfqw==Example:export SHOREBIRD_TOKEN="$SHOREBIRD_TOKEN" && shorebird patch android
Next, copy the generated SHOREBIRD_TOKEN and navigate to your GitHub
repository secrets via:
"Settings" -> "Secrets and variables" -> "Actions".
Then, click "New repository secret" and paste your SHOREBIRD_TOKEN: