kilo-app Release #15
This file contains hidden or 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: kilo-app Release | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: kilo-app-release | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-changes: | |
| runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }} | |
| timeout-minutes: 5 | |
| outputs: | |
| should_build: ${{ steps.check.outputs.should_build }} | |
| steps: | |
| - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for changes since last release | |
| id: check | |
| run: | | |
| # Find the latest kilo-app release tag | |
| LAST_TAG=$(git tag --list 'kilo-app-release/*' --sort=-creatordate | head -n 1) | |
| if [ -z "$LAST_TAG" ]; then | |
| echo "No previous release tag found — first build" | |
| echo "should_build=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "Last release tag: $LAST_TAG" | |
| # Check for changes in kilo-app or trpc since that tag | |
| CHANGES=$(git diff --name-only "$LAST_TAG"..HEAD -- apps/mobile/ packages/trpc/ pnpm-lock.yaml) | |
| if [ -z "$CHANGES" ]; then | |
| echo "No changes since $LAST_TAG — skipping build" | |
| echo "should_build=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Changes detected since $LAST_TAG:" | |
| echo "$CHANGES" | |
| echo "should_build=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| build-and-submit: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.should_build == 'true' && github.ref == 'refs/heads/main' | |
| runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }} | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 | |
| with: | |
| lfs: true | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install EAS CLI | |
| run: pnpm install --global eas-cli@latest | |
| - name: Build and submit | |
| working-directory: apps/mobile | |
| env: | |
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
| run: eas build --profile production --platform all --submit --non-interactive | |
| - name: Tag release | |
| run: | | |
| TAG="kilo-app-release/$(date -u +%Y-%m-%d)-$(git rev-parse --short=7 HEAD)" | |
| git tag "$TAG" | |
| git push origin "$TAG" |