|
| 1 | +name: ComLock Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + # =========================================================================== |
| 10 | + # WEB BUILD |
| 11 | + # =========================================================================== |
| 12 | + build-web: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v3 |
| 16 | + |
| 17 | + - name: Setup Node |
| 18 | + uses: actions/setup-node@v3 |
| 19 | + with: |
| 20 | + node-version: 18 |
| 21 | + |
| 22 | + - name: Install Rust |
| 23 | + uses: dtolnay/rust-toolchain@stable |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + working-directory: ./comlock-app |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: Build Web |
| 30 | + working-directory: ./comlock-app |
| 31 | + run: npm run build |
| 32 | + |
| 33 | + - name: Zip Dist |
| 34 | + working-directory: ./comlock-app |
| 35 | + run: zip -r comlock-web-${{ github.ref_name }}.zip dist |
| 36 | + |
| 37 | + - name: Upload Web Artifact |
| 38 | + uses: actions/upload-artifact@v3 |
| 39 | + with: |
| 40 | + name: web-dist |
| 41 | + path: comlock-app/comlock-web-${{ github.ref_name }}.zip |
| 42 | + |
| 43 | + # =========================================================================== |
| 44 | + # ANDROID BUILD |
| 45 | + # =========================================================================== |
| 46 | + build-android: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + needs: build-web |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v3 |
| 51 | + |
| 52 | + - name: Setup Node |
| 53 | + uses: actions/setup-node@v3 |
| 54 | + with: |
| 55 | + node-version: 18 |
| 56 | + |
| 57 | + - name: Install Rust |
| 58 | + uses: dtolnay/rust-toolchain@stable |
| 59 | + with: |
| 60 | + targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android |
| 61 | + |
| 62 | + - name: Install dependencies |
| 63 | + working-directory: ./comlock-app |
| 64 | + run: npm ci |
| 65 | + |
| 66 | + - name: Build Android APK |
| 67 | + uses: tauri-apps/tauri-action@v0 |
| 68 | + env: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + with: |
| 71 | + projectPath: ./comlock-app |
| 72 | + tagName: ${{ github.ref_name }} |
| 73 | + releaseName: 'ComLock ${{ github.ref_name }}' |
| 74 | + releaseBody: 'See the assets to download this version and install.' |
| 75 | + modKey: ${{ secrets.ANDROID_KEYSTORE }} |
| 76 | + args: android build --apk |
| 77 | + |
| 78 | + # =========================================================================== |
| 79 | + # iOS BUILD |
| 80 | + # =========================================================================== |
| 81 | + build-ios: |
| 82 | + runs-on: macos-latest |
| 83 | + needs: build-web |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v3 |
| 86 | + |
| 87 | + - name: Setup Node |
| 88 | + uses: actions/setup-node@v3 |
| 89 | + with: |
| 90 | + node-version: 18 |
| 91 | + |
| 92 | + - name: Install Rust |
| 93 | + uses: dtolnay/rust-toolchain@stable |
| 94 | + with: |
| 95 | + targets: aarch64-apple-ios,x86_64-apple-ios |
| 96 | + |
| 97 | + - name: Install dependencies |
| 98 | + working-directory: ./comlock-app |
| 99 | + run: npm ci |
| 100 | + |
| 101 | + - name: Build iOS IPA |
| 102 | + uses: tauri-apps/tauri-action@v0 |
| 103 | + env: |
| 104 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 105 | + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} |
| 106 | + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |
| 107 | + APPLE_MOBILE_PROVISIONING_PROFILE: ${{ secrets.APPLE_MOBILE_PROVISIONING_PROFILE }} |
| 108 | + with: |
| 109 | + projectPath: ./comlock-app |
| 110 | + tagName: ${{ github.ref_name }} |
| 111 | + releaseName: 'ComLock ${{ github.ref_name }}' |
| 112 | + releaseBody: 'See the assets to download this version and install.' |
| 113 | + args: ios build |
| 114 | + |
| 115 | + # =========================================================================== |
| 116 | + # CREATE RELEASE |
| 117 | + # =========================================================================== |
| 118 | + create-release: |
| 119 | + runs-on: ubuntu-latest |
| 120 | + needs: [build-web, build-android, build-ios] |
| 121 | + steps: |
| 122 | + - uses: actions/download-artifact@v3 |
| 123 | + with: |
| 124 | + name: web-dist |
| 125 | + |
| 126 | + - name: Release |
| 127 | + uses: softprops/action-gh-release@v1 |
| 128 | + if: startsWith(github.ref, 'refs/tags/') |
| 129 | + with: |
| 130 | + files: | |
| 131 | + comlock-web-*.zip |
| 132 | + comlock-app/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk |
| 133 | + comlock-app/src-tauri/gen/apple/build/Release-iphoneos/comlock_app.ipa |
0 commit comments