expo / expo-github-action

Expo GitHub Action makes it easy to automate EAS builds or updates
MIT License
772 stars 76 forks source link

Expo publish no longer exit after publish success - Github Action #99

Closed kokorolx closed 3 years ago

kokorolx commented 3 years ago

Description of the bug

How would you shortly summarise the issue?

I want every PR will create a release channel, and I choose GitHub action to do that. My environment:

node -v
v14.17.0

yarn -v
1.22.10

expo --version
4.5.2
expo-cli --version
4.5.2

My package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@eva-design/eva": "^2.1.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@ui-kitten/components": "^5.1.0",
    "@ui-kitten/eva-icons": "^5.1.0",
    "expo": ">=41.0.1",
    "expo-status-bar": "~1.0.4",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-reanimated": "~2.1.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.0.0",
    "react-native-svg": "^12.1.1",
    "react-native-web": "~0.13.12",
    "react-navigation": "^4.4.4",
    "tailwind-react-native-classnames": "^1.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@ui-kitten/metro-config": "^5.1.0"
  },
  "private": true,
  "engines": {
    "node": "^14.17"
  }
}

My app.json

{
  "expo": {
    "name": "newApp",
    "slug": "newApp",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      },
      "package": "com.kokoro.le.newApp"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

My workflow.yml

name: Expo Review
on: [pull_request]
jobs:
  preReview:
    name: Install and publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - uses: expo/expo-github-action@v5
        with:
          expo-version: 4.x
          expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
          expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}

      - name: Cache node modules
        uses: actions/cache@v2
        env:
          cache-name: cache-node-modules
        with:
          # npm cache files are stored in `~/.npm` on Linux/macOS
          path: ~/.npm
          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
      - name: yarn install
        run: yarn install
      - name: expo publish --release-channel=pr-${{ github.event.number }}
        run: expo publish --release-channel=pr-${{ github.event.number }}

      - uses: unsplash/comment-on-pr@master
        env:
          GITHUB_TOKEN: ${{ secrets.GH_BUILD_TOKEN }}
        with:
          msg: App is ready for review, you can [see it here](https://expo.io/${{ secrets.EXPO_CLI_USERNAME }}/use-expo?release-channel=pr-${{ github.event.number }}).

To Reproduce

What steps did you perform which led to this issue?

I create the PR on GitHub, and the Action will auto-run. After Publish complete it not continue.

Expected behavior

What did you expect to have happened? After Publish complete it not continue.

Actual behavior

What did it actually result in? It took me 2 hours to take this action, when I found out it couldn't continue, I canceled this action.

Here is the full log of this action: Full log

Additional context

Can you further explain the issue? E.g., information about version/environment or screenshots.

My question is: How can I continue if Publish complete?

Sorry for my poor English.

byCedric commented 3 years ago

Hi @kokorolx! I'm not exactly sure what's going on here. In the log you provided it says it's being "canceled", that's probably a manual action or a side-effect of another job failing.

I double-checked the behavior of this in bycedric/eas-monorepo-example. Here you can see the "Publish to Expo" step succeeding and posting a QR code for the PR.

If you are able, could you provide a repository where this happens? With that, I can do some tests to see what part is blocking the action.

kokorolx commented 3 years ago

Hi @kokorolx! I'm not exactly sure what's going on here. In the log you provided it says it's being "canceled", that's probably a manual action or a side-effect of another job failing.

I double-checked the behavior of this in bycedric/eas-monorepo-example. Here you can see the "Publish to Expo" step succeeding and posting a QR code for the PR.

If you are able, could you provide a repository where this happens? With that, I can do some tests to see what part is blocking the action.

Oh, I canceled because it was running up to 2 hours. It published to repo successfully but it does not stop to progress publish. I will copy your workflows/preview.yml and run it again.

kokorolx commented 3 years ago

@byCedric After updated the github/workflows/preview.yml It's still not working. image And it's still running.

My new preview.yml

name: preview
on: [workflow_dispatch, pull_request]
jobs:
  preview:
    name: Publish preview
    runs-on: ubuntu-latest
    if: github.event.pull_request.head.repo.full_name == 'kokorolx/share_opus_mobile_app'
    strategy:
      matrix:
        app: [managed]
    steps:
      - name: Setup repo
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - name: Setup Expo
        uses: expo/expo-github-action@v5
        with:
          expo-cache: true
          expo-version: 4.x
          expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
          expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
      - name: Find cache
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - name: Restore cache
        uses: actions/cache@v2
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-
      - name: Install dependencies
        run: yarn install --frozen-lockfile --check-files
      - name: Build packages
        run: yarn build
      - name: Publish to Expo
        run: expo publish --release-channel=pr-${{ github.event.number }}
      - name: Get deployment link
        run: echo "::set-output name=path::@kokoro.lee/use-expo?release-channel=pr-${{ github.event.number }}"
        id: expo
      - name: Comment deployment link
        uses: unsplash/comment-on-pr@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          msg: You can preview [`apps/${{ matrix.app }}` here](https://expo.io/${{ steps.expo.outputs.path }}).<br><br><a href="https://exp.host/${{ steps.expo.outputs.path }}"><img src="https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=exp://exp.host/${{ steps.expo.outputs.path }}" height="200px" width="200px"></a>

If you are able, could you provide a repository where this happens? With that, I can do some tests to see what part is blocking the action.

Oh sorry, but if you want any info, I will provide it for you.

Do I need to upgrade my expo account to Priority plan?

byCedric commented 3 years ago

Hmm, your workflow seems good. I don't know why it's blocking the publish step for you. expo publish isn't affected by the priority plan, only your builds are queued without it. I'm afraid I need access to a repository to fully investigate this.

kokorolx commented 3 years ago

Oh, I found that issue by the package: @ui-kitten/metro-config I removed it and now the github action working correctly. Thank you for your support @byCedric

byCedric commented 3 years ago

Awesome! Glad you got it working :)