Skip to content

Removed module type. #10

Removed module type.

Removed module type. #10

name: EAS Build & Release
on:
push:
branches: [main]
workflow_dispatch:
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Update Version (Production)
if: github.ref == 'refs/heads/main'
run: node scripts/version-update.js
- name: Set CI/CD Versions
run: |
echo "BUILD_NUMBER=${{ github.run_id }}" >> $GITHUB_ENV
echo "BUILD_DATE=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
if [ "${{ github.ref }}" != "refs/heads/main" ]; then
echo "APP_VERSION=1.0.0-prerelease.${{ github.run_number }}" >> $GITHUB_ENV
else
echo "APP_VERSION=$(node -p "require('./app.config.js').expo.version")" >> $GITHUB_ENV
fi
- name: Configure Git
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add app.config.js
git commit -m "chore: Auto-increment version [skip ci]"
git push
- name: Install EAS CLI
run: npm install -g eas-cli@latest
- name: Build Production
run: eas build -p android --profile production --non-interactive
env:
APP_VERSION: ${{ env.APP_VERSION }}
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
BUILD_DATE: ${{ env.BUILD_DATE }}
- name: Create Release
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
gh release create "v${{ env.APP_VERSION }}" \
--title "v${{ env.APP_VERSION }}" \
--notes "Production release"
else
gh release create "nightly-${{ env.BUILD_DATE }}" \
--title "Nightly Build (${{ env.BUILD_DATE }})" \
--notes "Preview build"
fi
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}