diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a66f2b..16a81c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,3 +48,45 @@ jobs: app: ${{ secrets.FIREBASE_APP_ID }} credentials: ${{ secrets.FIREBASE_CREDENTIALS }} cache: false + test-node-version-16: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v4 + with: + node-version: '16.x' + - name: Run nickwph/firebase-app-distribution-action@v1 + uses: ./ + with: + file: .github/workflows/assets/app-debug.apk + app: ${{ secrets.FIREBASE_APP_ID }} + credentials: ${{ secrets.FIREBASE_CREDENTIALS }} + cache: false + test-node-version-18: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + - name: Run nickwph/firebase-app-distribution-action@v1 + uses: ./ + with: + file: .github/workflows/assets/app-debug.apk + app: ${{ secrets.FIREBASE_APP_ID }} + credentials: ${{ secrets.FIREBASE_CREDENTIALS }} + cache: false + test-node-version-21: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v4 + with: + node-version: '21.x' + - name: Run nickwph/firebase-app-distribution-action@v1 + uses: ./ + with: + file: .github/workflows/assets/app-debug.apk + app: ${{ secrets.FIREBASE_APP_ID }} + credentials: ${{ secrets.FIREBASE_CREDENTIALS }} + cache: false diff --git a/action.yml b/action.yml index 8413464..2b2a523 100644 --- a/action.yml +++ b/action.yml @@ -54,6 +54,15 @@ inputs: runs: using: composite steps: + - name: Checking node version + id: node-version-above-18 + shell: bash + run: bash etc/compare-node-version.sh + continue-on-error: true + - uses: actions/setup-node@v4 + if: ${{ steps.node-version-above-18.conclusion == 'failure' }} + with: + node-version: '18.x' - uses: actions/cache@v3 if: ${{ inputs.cache == 'true' }} env: { cache-name: firebase-app-distribution-action } diff --git a/etc/compare-node-version.sh b/etc/compare-node-version.sh new file mode 100644 index 0000000..5d3f93b --- /dev/null +++ b/etc/compare-node-version.sh @@ -0,0 +1,10 @@ +#!/bin/bash +nodever="$(node --version)" +currentver="${nodever:1}" +requiredver="18.0.0" +if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then + exit 0 +else + echo "Current NodeJS version is v${currentver}, which is lower than required version v${requiredver}" + exit 1 +fi \ No newline at end of file