nightly #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nightly | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build-android: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout private repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
fetch-tags: true | |
repository: Liminova/charlotte-mobile | |
token: ${{ secrets.PAT_TOKEN }} | |
- name: Get latest Git hash & commit count | |
id: sha | |
run: | | |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
echo "commits_count=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)" >> $GITHUB_OUTPUT | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Configure Git for private packages | |
run: | | |
git config --global url."https://${{ secrets.PAT_TOKEN }}@github.com/".insteadOf "[email protected]:" | |
git config --global url."https://".insteadOf "git://" | |
- name: Install dependencies | |
run: | | |
pnpm install --frozen-lockfile --prod | |
# - name: Get version from app.config.js | |
# id: app_version | |
# run: | | |
# VERSION=$(node -p "require('./app.config.js').expo.version") | |
# echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Install EAS CLI | |
run: pnpm i -g eas-cli | |
- name: Build Android | |
run: eas build --local --platform android --profile preview --non-interactive | |
env: | |
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
COMMIT_HASH: ${{ steps.sha.outputs.short_sha }} | |
COMMITS_COUNT: ${{ steps.sha.outputs.commits_count }} | |
- name: Create nightly release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Nightly v1.0.0-${{ steps.sha.outputs.short_sha }} | |
tag_name: nightly | |
repository: Liminova/charlotte-mobile | |
token: ${{ secrets.PAT_TOKEN }} | |
body: | | |
Automated build created by GitHub Actions | |
Build Date: ${{ github.event.repository.updated_at }} | |
Commit: ${{ github.sha }} | |
Version: v1.0.0-${{ steps.sha.outputs.short_sha }} | |
draft: false | |
prerelease: true | |
files: | | |
./*.apk |