Add reactivate button for used_up/decluttered items #39
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: Build & Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| desktop: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: windows-latest | |
| args: '' | |
| - platform: ubuntu-22.04 | |
| args: '' | |
| - platform: macos-latest | |
| args: '--target aarch64-apple-darwin' | |
| - platform: macos-latest | |
| args: '--target x86_64-apple-darwin' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Write Turso env | |
| run: | | |
| echo "VITE_TURSO_DATABASE_URL=${{ secrets.TURSO_DATABASE_URL }}" >> .env | |
| echo "VITE_TURSO_AUTH_TOKEN=${{ secrets.TURSO_AUTH_TOKEN }}" >> .env | |
| - name: Build Tauri app | |
| uses: tauri-apps/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| releaseName: 'Use Up ${{ github.ref_name }}' | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| android: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Setup NDK | |
| uses: nttld/setup-ndk@v1 | |
| id: setup-ndk | |
| with: | |
| ndk-version: r25b | |
| local-cache: true | |
| - name: Restore Android symlinks | |
| run: | | |
| directory="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin" | |
| find "$directory" -type l | while read link; do | |
| current_target=$(readlink "$link") | |
| new_target="$directory/$(basename "$current_target")" | |
| ln -sf "$new_target" "$link" | |
| done | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Write Turso env | |
| run: | | |
| echo "VITE_TURSO_DATABASE_URL=${{ secrets.TURSO_DATABASE_URL }}" >> .env | |
| echo "VITE_TURSO_AUTH_TOKEN=${{ secrets.TURSO_AUTH_TOKEN }}" >> .env | |
| - name: Init Tauri Android | |
| run: npx tauri android init | |
| env: | |
| NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| - name: Patch Android for system bar insets | |
| run: | | |
| MAIN_KT="src-tauri/gen/android/app/src/main/java/com/alexandrosnt/useup/MainActivity.kt" | |
| GRADLE="src-tauri/gen/android/app/build.gradle.kts" | |
| printf '%s\n' \ | |
| 'package com.alexandrosnt.useup' \ | |
| '' \ | |
| 'import android.os.Bundle' \ | |
| 'import android.view.View' \ | |
| 'import androidx.core.view.ViewCompat' \ | |
| 'import androidx.core.view.WindowInsetsCompat' \ | |
| 'import androidx.core.view.updatePadding' \ | |
| '' \ | |
| 'class MainActivity : TauriActivity() {' \ | |
| ' override fun onCreate(savedInstanceState: Bundle?) {' \ | |
| ' super.onCreate(savedInstanceState)' \ | |
| ' val contentView = findViewById<View>(android.R.id.content)' \ | |
| ' ViewCompat.setOnApplyWindowInsetsListener(contentView) { view, insets ->' \ | |
| ' val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())' \ | |
| ' view.updatePadding(bottom = systemBars.bottom)' \ | |
| ' insets' \ | |
| ' }' \ | |
| ' }' \ | |
| '}' > "$MAIN_KT" | |
| if ! grep -q "androidx.core:core-ktx" "$GRADLE"; then | |
| sed -i '/dependencies {/a\ implementation("androidx.core:core-ktx:1.13.1")' "$GRADLE" | |
| fi | |
| - name: Build Android APK | |
| run: npx tauri android build --apk | |
| env: | |
| NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| - name: Sign APK | |
| if: env.HAS_SIGNING_KEY == 'true' | |
| id: sign-apk | |
| uses: kevin-david/zipalign-sign-android-release@v2 | |
| env: | |
| HAS_SIGNING_KEY: ${{ secrets.ANDROID_KEY_BASE64 != '' }} | |
| BUILD_TOOLS_VERSION: '35.0.0' | |
| with: | |
| releaseDirectory: src-tauri/gen/android/app/build/outputs/apk/universal/release | |
| signingKeyBase64: ${{ secrets.ANDROID_KEY_BASE64 }} | |
| alias: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| keyStorePassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| - name: Upload APK to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| files: | | |
| src-tauri/gen/android/app/build/outputs/apk/**/*.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ios: | |
| permissions: | |
| contents: write | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-ios | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Write Turso env | |
| run: | | |
| echo "VITE_TURSO_DATABASE_URL=${{ secrets.TURSO_DATABASE_URL }}" >> .env | |
| echo "VITE_TURSO_AUTH_TOKEN=${{ secrets.TURSO_AUTH_TOKEN }}" >> .env | |
| - name: Init Tauri iOS | |
| run: npx tauri ios init | |
| - name: Patch iOS plist for camera permission | |
| run: | | |
| PLIST=$(find src-tauri/gen/apple -name "Info.plist" -path "*_iOS*" | head -1) | |
| if [ -n "$PLIST" ]; then | |
| /usr/libexec/PlistBuddy -c "Add :NSCameraUsageDescription string 'Use Up needs camera access to scan product barcodes'" "$PLIST" 2>/dev/null || true | |
| fi | |
| - name: Disable code signing in Xcode project | |
| run: | | |
| PBXPROJ="src-tauri/gen/apple/app.xcodeproj/project.pbxproj" | |
| # Clear any signing identity | |
| sed -i '' 's/CODE_SIGN_IDENTITY = ".*"/CODE_SIGN_IDENTITY = ""/g' "$PBXPROJ" | |
| sed -i '' 's/"CODE_SIGN_IDENTITY\[sdk=iphoneos\*\]" = ".*"/"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""/g' "$PBXPROJ" | |
| # Remove development team | |
| sed -i '' '/DEVELOPMENT_TEAM/d' "$PBXPROJ" | |
| # Inject CODE_SIGNING_ALLOWED = NO into every buildSettings block | |
| awk '/buildSettings = \{/ { print; print "\t\t\t\tCODE_SIGNING_ALLOWED = NO;"; print "\t\t\t\tCODE_SIGNING_REQUIRED = NO;"; next }1' "$PBXPROJ" > "$PBXPROJ.tmp" && mv "$PBXPROJ.tmp" "$PBXPROJ" | |
| - name: Build iOS (unsigned) | |
| continue-on-error: true | |
| run: npx tauri ios build | |
| - name: Package unsigned IPA | |
| run: | | |
| # Find the xcarchive (tauri puts it under src-tauri/gen/apple/build/) | |
| ARCHIVE=$(find src-tauri/gen/apple/build -name "*.xcarchive" -type d 2>/dev/null | head -1) | |
| if [ -z "$ARCHIVE" ]; then | |
| echo "Searching DerivedData for archive..." | |
| ARCHIVE=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcarchive" -type d 2>/dev/null | head -1) | |
| fi | |
| if [ -z "$ARCHIVE" ]; then | |
| echo "ERROR: No xcarchive found" | |
| find src-tauri/gen/apple/build -type d -maxdepth 4 2>/dev/null || true | |
| exit 1 | |
| fi | |
| echo "Found archive: $ARCHIVE" | |
| ls -la "$ARCHIVE/Products/Applications/" || true | |
| mkdir -p Payload | |
| cp -r "$ARCHIVE/Products/Applications/"*.app Payload/ | |
| zip -r UseUp-unsigned.ipa Payload | |
| - name: Upload IPA to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| files: UseUp-unsigned.ipa | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |