Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the output from "eas build" #256

Open
ddennis opened this issue Feb 5, 2024 · 1 comment
Open

Using the output from "eas build" #256

ddennis opened this issue Feb 5, 2024 · 1 comment

Comments

@ddennis
Copy link

ddennis commented Feb 5, 2024

Description of the bug

This is most likely just me not understanding the docs or how to use the shell commands.

I have also looked into to the preview but i am not using eas update and i am currently not handling updates through PR.

My use case
I want to be able to post a slack message when the build has completed. If possible include a QR code to the download page, or a qr code directly downloading the apk.

Others have asked the same, i have linked issues below.

After giving up trying to use a build in action. I am now trying to build my own script that does the actual sending, but i dont understand how to get the output from the run command. Any help would be much appreciated.

I am expecting to be able to use the output from either this

  - name: 🚀 Build app
    id: build_cmd
    run: eas build --profile ad-hoc --platform android --non-interactive  --json

or this

  - name: 🚀 Build app
    id: buildcmd
    run:  eas build:list --gitCommitHash=${{ github.sha }} --json --non-interactive --channel=ad-hoc 

To Reproduce

  - name: 🚀 Build app
    id: buildcmd
    run:  eas build:list --gitCommitHash=${{ github.sha }} --json --non-interactive --channel=ad-hoc 

  - name: npm output josn build
    id: my_jsno_npm
    run: node ./scripts/publish-build.js ${{ steps.buildcmd.outputs }}

or

  - name: 🚀 Build app
    id: buildcmd
    run: |
      {
        echo 'JSON_RESPONSE<<EOF'
        eas build:list --gitCommitHash=xxxxxxxxxxx --json --non-interactive --channel=ad-hoc
        echo EOF
      } >> "$GITHUB_ENV"

    - name: npm output josn build
    id: my_jsno_npm
    run: node ./scripts/publish-build.js ${{ toJSON(env.JSON_RESPONSE)  }}

Expected behavior

NA

Actual behavior

NA

Additional context

I have been through similar question but did not find the answer
#176 pass job output to another job
#184 QR Code and DeepLink not showed on Slack channel
#215 Expose build id when build step is completed

@ddennis
Copy link
Author

ddennis commented Feb 5, 2024

I got it working this way.
It's not pretty. Please if its possible to get the same functionality using an action i would appreciate some support.

  - name: 🚀 Build app
    id: buildcmd
    run: |
      {
        echo 'JSON_RESPONSE<<EOF'
        eas build:list --gitCommitHash=${{ github.sha }} --json --non-interactive --channel=ad-hoc
        echo EOF
      } >> "$GITHUB_ENV"

  - name: Run node script
    id: my_jsno_npm
    run: node ./scripts/publish-build.js ${{ toJSON(env.JSON_RESPONSE)  }}

node script:

const [command] = process.argv.slice(2)
const clean = command.replaceAll(/\\n/g, '')
const parsedObj = JSON.parse(clean)

const buildObject = parsedObj[0]
const linkToBuildPage = 'https://expo.dev/accounts/my-org/projects/some-app/builds/' + buildObject.id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant