name: Luggage List Build on: push: branches: - main paths: - '**/*.js' - '**/*.json' - '.gitea/workflows/**' jobs: vitests: runs-on: ubuntu-latest steps: - name: ๐Ÿ— Setup repo uses: actions/checkout@v2 - name: ๐Ÿ— Setup Node uses: actions/setup-node@v2 with: node-version: 22 - name: ๐Ÿ— Setup pnpm uses: pnpm/action-setup@v4 with: version: latest - name: ๐Ÿ“ฆ Install dependencies run: pnpm install - name: ๐Ÿงช Run vitests run: pnpm test build-android: runs-on: ubuntu-latest steps: - name: ๐Ÿ— Setup repo uses: actions/checkout@v2 - name: ๐Ÿ— Setup Node uses: actions/setup-node@v2 with: node-version: 22 - name: ๐Ÿ— Setup pnpm uses: pnpm/action-setup@v4 with: version: latest - name: ๐Ÿ— Setup Java uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - name: ๐Ÿ— Setup Android SDK uses: android-actions/setup-android@v3 - name: ๐Ÿ— Setup Expo and EAS uses: expo/expo-github-action@v8 with: token: ${{ secrets.EXPO_TOKEN }} eas-version: latest packager: pnpm - name: ๐Ÿ“ฆ Install dependencies run: pnpm install - name: ๐Ÿ‘ท Build app run: | eas build --local \ --non-interactive \ --output=./app-build \ --platform=android \ --profile=preview - name: ๐Ÿ“ Rename build to APK run: mv app-build luggage-list-release.apk - name: ๐Ÿ“ค Upload build artifact uses: actions/upload-artifact@v3 with: name: luggage-list-android-preview-build path: luggage-list-release.apk if-no-files-found: error build-web: runs-on: ubuntu-latest steps: - name: ๐Ÿ— Setup repo uses: actions/checkout@v2 - name: ๐Ÿ— Setup Node uses: actions/setup-node@v2 with: node-version: 22 - name: ๐Ÿ— Setup pnpm uses: pnpm/action-setup@v4 with: version: latest - name: ๐Ÿ— Setup Expo and EAS uses: expo/expo-github-action@v8 with: token: ${{ secrets.EXPO_TOKEN }} eas-version: latest packager: pnpm - name: ๐Ÿ“ฆ Install dependencies run: pnpm install - name: ๐Ÿ‘ท Build web run: npx expo export --platform web - name: ๐Ÿ“ฆ Zip dist run: cd dist && zip -r ../luggage-list-dist.zip . - name: ๐Ÿ“ค Upload build artifact uses: actions/upload-artifact@v3 with: name: luggage-list-web-build path: luggage-list-dist.zip if-no-files-found: error release: runs-on: ubuntu-latest needs: [build-android, build-web, vitests] steps: - name: ๐Ÿ— Setup repo uses: actions/checkout@v2 - name: ๐Ÿ“ฅ Download Android artifact uses: actions/download-artifact@v3 with: name: luggage-list-android-preview-build - name: ๐Ÿ“ฅ Download Web artifact uses: actions/download-artifact@v3 with: name: luggage-list-web-build - name: ๐Ÿท Create tag run: | TAG="luggage-list-build-$(git rev-parse --short HEAD)" git tag "$TAG" git push origin "$TAG" echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV - name: ๐Ÿš€ Create release uses: softprops/action-gh-release@v1 with: tag_name: ${{ env.RELEASE_TAG }} name: ${{ env.RELEASE_TAG }} files: | luggage-list-release.apk luggage-list-dist.zip generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}