Skip to main content

Integrations

Wolfia provides a range of integrations to automate generating magic links using the Wolfia API. Magic links created through the API will automatically appear on your dashboard.

  • GitHub Actions (live)
  • GitLab plugin (coming soon)
  • Bitbucket plugin (coming soon)

GitHub Actions

Wolfia provides an open-source GitHub action to automate generating magic links in your continuous integration workflow. This guide will provide a step-by-step walkthrough of adding the Wolfia GitHub action to your existing or new workflow. You can learn more about GitHub Actions and Workflows here.

Step 1: Create a Wolfia API Key

If you already have an api key, go to step 2. If not, create a new wolfia api key by logging into wolfia and navigating to the settings page. You can generate a new API key by clicking the + create button.

Settings page

After creating a new API key, copy and store your API Key ID and API Key Secret in your secrets store (e.g. AWS Secrets manager, Vault, etc.) API Key Secret should be treated as a password and securely stored.

Step 2: Set up GitHub workflow

Integrate the Wolfia's GitHub action with an existing workflow by adding the following yaml:

steps:
- name: Upload apk and generate wolfia magic link
uses: wolfia-app/wolfia-github-action@v1.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
wolfia-api-key-id: ${{ secrets.WOLFIA_API_KEY_ID }}
wolfia-api-key-secret: ${{ secrets.WOLFIA_API_KEY_SECRET }}
# replace with your own app path
app-path: path/to/artifact/app.apk
link-description: Custom link description

Or create a new workflow by creating the yaml file at path, <repo's root folder>/.github/workflows/wolfia.yml with the following contents:

name: Upload app and generate wolfia magic link

on:
push:
branches:
- '*'
- '!main'
pull_request:
branches:
- '*'

jobs:
gradle:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Gradle to generate APK
run: ./gradlew assembleDebug --continue

- name: Upload apk and generate wolfia magic link
uses: wolfia-app/wolfia-github-action@v1.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
wolfia-api-key-id: ${{ secrets.WOLFIA_API_KEY_ID }}
wolfia-api-key-secret: ${{ secrets.WOLFIA_API_KEY_SECRET }}
# replace with your own app path
app-path: ./app/build/outputs/apk/debug/app-debug.apk
link-description: Custom link description

Step 3: Set up inputs for the action

As referenced in the Wolfia GitHub action documentation and the yaml above, the following are the required inputs for the action. Here are the step-by-step instructions to set up the inputs to be consumed by the action.

github-token

The GITHUB_TOKEN is automatically provided by GitHub actions, by default. So, all you need to do is add github-token: ${{ secrets.GITHUB_TOKEN }} to your with block and you should be set.

wolfia-api-key-id & wolfia-api-key-secret

After generating the api key from wolfia, you should save the key id and key secret as encrypted secrets for your repository.

  1. After navigating to the settings page for your repository, expand the Secret menu and select the actions item
  2. Click the New Repository Secret button and enter WOLFIA_API_KEY_ID as the Name and your wolfia api key id as the Value without quotes. Then, click Add secret
  3. Click the New Repository Secret button and enter WOLFIA_API_KEY_SECRET as the Name and your wolfia api key secret as the Value without quotes. Then, click Add secret

After adding the secrets, you should be able to see them in the Action Secrets section, as shown below in the screenshot.

Encrypted secrets

After the secrets are saved as repository secrets, you can reference them in your workflow file as wolfia-api-key-secret: ${{ secrets.WOLFIA_API_KEY_SECRET }}.

app-path

This references the relative path to the apk in your build process. Each wolfia action accepts only one apk, and if you need to generate multiple links based on the flavor/variant of your app, you can do that by having multiple actions in your workflow.

You can usually find the android apks inside the build folder, with the path /build/outputs/apk/[variant]/[app-name].apk

Step 4: Trigger the wolfia workflow

Once the workflow and inputs are set up correctly, you can trigger the workflow by pushing a new commit or by going to the actions tab in your repository and triggering the specific workflow manually.

After the workflow is successfully complete, you will see a comment from the github-bot with the magic link embedded in it:

Wolfia magic link comment

The magic link should also appear on your wolfia dashboard with the PR name and Git SHA.

Wolfia dashboard