Download apk/ipa file directly from link in slack

Referring to this closed discussion Formatted Slack message after successful build, is there a way to download the apk/ipa generated directly from the link via slack? or have a public download page for it? Bitrise has this and I was wondering if CircleCI does too. Thanks

Hello

You would need to push the file to a place where it could be stored so that it can be downloaded.

Within CircleCI you could store this as an artefact and our documentation can be found here.

Below is a config I just made which will copy my Dockerfile to a folder which is just being used to add a file to be used as an artefact then it runs a second workflow that pulls the latest artefact using the API where CIRCLE_TOKEN is a personal API token defined as an environmental variable for security.

version: 2.1
jobs:
  build:
    docker:
      - image: cimg/base:2022.08
    steps:
      - checkout
      - run: mkdir ~/file
      - run: cp ~/project/Dockerfile ~/file
      - store_artifacts:
          path: ~/file
  pull:
    docker:
      - image: cimg/base:2022.08
    steps:
      - run: 
          command: | 
            curl -s -H "Circle-Token: $CIRCLE_TOKEN" https://circleci.com/api/v1.1/project/github/owenjoliver/sandbox/latest/artifacts | grep -o 'https://[^"]*'
            
workflows:
  workflow:
    jobs:
    - build
    - pull:
        requires:
          - build

The second workflow outputs the url to the aretfact which could be included on your slack message to take the user to where the file is.

Kind Regards
Owen Oliver

Noted. Thanks Owen :slight_smile: . It’d be great if CircleCI can have something like a public install page. Helps a lot when need to install app in many devices. In the meantime, I’ll use the above solution.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.