nightly #15
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: | |
ref: "feat/nativewind" | |
repository: Liminova/charlotte-mobile | |
token: ${{ secrets.PAT_TOKEN }} | |
- name: Get latest Git hash | |
id: sha | |
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $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 current version | |
id: version | |
run: | | |
if [ -f "app.config.js" ]; then | |
VERSION=$(node -p "require('./app.config.js').expo.version") | |
else | |
VERSION=$(jq -r '.expo.version' app.json) | |
fi | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Update version in app.config.js | |
run: | | |
if [ -f "app.config.js" ]; then | |
sed -i 's/version: "\([^"]*\)"/version: "\1-${{ steps.sha.outputs.short_sha }}"/' app.config.js | |
else | |
jq --arg v "${{ steps.version.outputs.version }}-${{ steps.sha.outputs.short_sha }}" '.expo.version = $v' app.json > tmp.json && mv tmp.json app.json | |
fi | |
- 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 }} | |
- name: Create nightly release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Build ${{ github.run_number }} (${{ steps.sha.outputs.short_sha }}) | |
tag_name: v${{ github.run_number }}-${{ steps.sha.outputs.short_sha }} | |
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: ${{ steps.version.outputs.version }}-${{ steps.sha.outputs.short_sha }} | |
draft: false | |
prerelease: true | |
files: | | |
./*.apk |