Skip to main content

Uploading installable artifacts

Abstract

You can upload a binary to Release Management via using our API endpoint, and even automatically select a successfully uploaded app binary as a release candidate. This is particularly useful if you use a different CI service instead of Bitrise.

There are two ways to upload installable artifacts to Release Management so they can be used as release candidates:

  • Generating them via a Bitrise build of a connected app.

  • Using our API endpoint. This is particularly useful if you use a different CI service instead of Bitrise.

  • Use our premade bash script to use the API endpoint.

Using a Bitrise build

If you use Bitrise CI, getting an installable artifact is only a matter of running a build that generates one:

  1. Make sure you have a connected app in Release Management.

  2. Run a Bitrise build that generates an IPA, AAB, or APK file.

All installable artifacts from successful builds will be available on the Artifacts page and can be selected as a release candidate.

Using the API

The API requires two requests to upload a binary:

  1. The first request is to get the upload URL. This request must contain:

    • Your API authentication token. Workspace tokens and personal access tokens are both accepted.

    • The slug of the connected app. This is automatically filled in if you get the request from the Release Management UI.

    • The file name and the file size in bytes.

  2. The second request is to upload the file to the upload URL. The request must contain:

    • The upload URL from the previous request.

    • The file name and the file size in bytes.

  3. Optionally, you can use a third request to check the status of the upload.

You can check the relevant endpoints in the official API documentation.

You can get the API requests from the Release candidate stage or the Artifacts page.

RC stage

Artifacts page

  1. Make sure you have a connected app in Release Management.

  2. Open your connected app.

  3. Select your release and go to the Release candidate stage.

  4. In the source card, click Configure.

    configure-source-rm.png
  5. In the dialog, select Upload via API.

  6. Get the curl command for the upload URL and then the curl command for the upload file. Replace [AUTH_TOKEN], [FILE_NAME], [FILE_SIZE] and [UPLOAD_URL] placeholders with the actual values.

    upload-url.png

    Bash script available

    You can also find a link to a bash script that you can use to set up your API calls easily.

  7. Optionally, check Automatically select after successful upload to make sure that your binary is automatically selected as a release candidate once the upload is successful.

    If you do not check this, you can select your release candidate from a list of artifacts.

  8. Click Save changes.

  9. Use the API requests to upload your artifacts.

  1. Make sure you have a connected app in Release Management.

  2. Open your connected app.

  3. Select Artifacts from the left navigation menu and go to the Upload via API tab.

  4. Click Configure.

    installable-artifacts-api.png
  5. Get the curl command for the upload URL and then the curl command for the upload file. Replace [AUTH_TOKEN], [FILE_NAME], [FILE_SIZE] and [UPLOAD_URL] placeholders with the actual values.

    Bash script available

    You can also find a link to a bash script that you can use to set up your API calls easily.

  6. Click OK, got it when you are ready.

  7. Use the API requests to upload your artifacts.

Using the bash script

To make using the API more convenient, we've created a bash script that simplifies the upload process. It supports Linux distributions (alpine, arch, centos, debian, fedora, rhel, ubuntu) and macOS. The script checks your system and then attempts to upload installable artifacts to Release Management.

To use the script:

  1. Get the script from GitHub.

  2. Make sure you have sudo privileges on your system OR jq and openssl packages installed.

  3. Set up the following Environment Variables in your system:

    • ARTIFACT_PATH: Local path of the artifact to be uploaded.

    • AUTHORIZATION_TOKEN: The access token for the Bitrise Release Management API. You can use a Bitrise personal access token or a Workspace token.

    • CONNECTED_APP_ID: The app ID of the connected app the artifact will be uploaded to. You can get the ID from the URL of the app's page on bitrise.io: https://app.bitrise.io/release-management/workspaces/WORKSPACE_ID/connected-apps/CONNECTED_APP_ID.

  4. Run the script.