chore: update app icon #12
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: expo/expo-github-action@v8 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - run: pnpm install | |
| - name: Sync version from tag | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| node -e " | |
| const fs = require('fs'); | |
| const app = JSON.parse(fs.readFileSync('app.json', 'utf8')); | |
| app.expo.version = '${VERSION}'; | |
| fs.writeFileSync('app.json', JSON.stringify(app, null, 2) + '\n'); | |
| const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
| pkg.version = '${VERSION}'; | |
| fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n'); | |
| " | |
| echo "Building version: $VERSION" | |
| - name: Commit version bump | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore(bump): ${{ github.ref_name }}" | |
| file_pattern: "app.json package.json" | |
| branch: main | |
| - run: eas build --platform android --profile preview --local --output ./thoughtbook.apk | |
| - name: Generate Release Notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| PREV_TAG=$(git tag --sort=-creatordate | sed -n '2p') | |
| CURRENT_TAG=${GITHUB_REF#refs/tags/} | |
| if [ -z "$PREV_TAG" ]; then | |
| COMMITS_RAW=$(git log --pretty=format:"%H %s" $CURRENT_TAG) | |
| else | |
| COMMITS_RAW=$(git log --pretty=format:"%H %s" ${PREV_TAG}..${CURRENT_TAG}) | |
| fi | |
| COMMITS="" | |
| AUTHORS="" | |
| while IFS= read -r line; do | |
| SHA=$(echo "$line" | cut -d' ' -f1) | |
| MSG=$(echo "$line" | cut -d' ' -f2-) | |
| # Skip version bump commits | |
| if echo "$MSG" | grep -q "^chore(bump):"; then | |
| continue | |
| fi | |
| # Get GitHub username from commit SHA | |
| USERNAME=$(gh api "repos/${{ github.repository }}/commits/${SHA}" --jq '.author.login' 2>/dev/null || echo "") | |
| if [ -n "$USERNAME" ]; then | |
| COMMITS="${COMMITS}\n- ${MSG} (@${USERNAME})" | |
| AUTHORS="${AUTHORS}\n${USERNAME}" | |
| else | |
| COMMITS="${COMMITS}\n- ${MSG}" | |
| fi | |
| done <<< "$COMMITS_RAW" | |
| UNIQUE_AUTHORS=$(echo -e "$AUTHORS" | sort -u | sed '/^$/d' | sed 's/^/@/' | paste -sd ", " -) | |
| { | |
| echo "## What's Changed" | |
| echo "" | |
| echo -e "$COMMITS" | |
| echo "" | |
| echo "## Contributors" | |
| echo "$UNIQUE_AUTHORS" | |
| } > release_notes.md | |
| - name: Upload APK to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ./thoughtbook.apk | |
| body_path: release_notes.md |