From 79220ec8a0358a7a8a2e95e25dae8cc9cbf68a29 Mon Sep 17 00:00:00 2001 From: Adrian Castro <22133246+castdrian@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:49:18 +0100 Subject: [PATCH] chore: adjust app repo and workflow --- .github/workflows/release-mobile.yml | 41 +++++++++------------------- apps/expo/app-repo.json | 11 ++------ 2 files changed, 15 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release-mobile.yml b/.github/workflows/release-mobile.yml index c19a7c75..eed0893b 100644 --- a/.github/workflows/release-mobile.yml +++ b/.github/workflows/release-mobile.yml @@ -172,9 +172,6 @@ jobs: app-repo: continue-on-error: true - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: [build-ios, release-app] steps: @@ -184,38 +181,26 @@ jobs: - name: Pull version bump run: git pull --all - - name: Install Node.js - uses: actions/setup-node@v4 + - name: Download IPA artifact + uses: actions/download-artifact@v4 with: - node-version: 21 + name: ipa - name: Get new version and release date id: vars run: | VERSION=$(jq -r '.version' apps/expo/package.json) - DATE=$(date -Iseconds) + DATE=$(date -u +"%Y-%m-%d") echo "::set-output name=version::$VERSION" echo "::set-output name=date::$DATE" - + - name: Update app-repo.json run: | - IPA_SIZE=$(stat -c%s "movie-web.ipa") - jq --arg IPA_SIZE "$IPA_SIZE" '.apps[0].versions[0].version = "${{ steps.vars.outputs.version }}" | .apps[0].versions[0].date = "${{ steps.vars.outputs.date }}" | .apps[0].versions[0].size = ($IPA_SIZE | tonumber)' apps/expo/app-repo.json > temp.json - mkdir -p pages - mv temp.json pages/repo.json - - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 - with: - source: ./pages - destination: ./_site - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + IPA_SIZE=$(stat -f%z "movie-web.ipa") + NEW_ENTRY=$(jq -n --arg version "${{ steps.vars.outputs.version }}" --arg date "${{ steps.vars.outputs.date }}" --arg size "$IPA_SIZE" --arg downloadURL "https://github.com/movie-web/native-app/releases/download/v${{ steps.vars.outputs.version }}/movie-web.ipa" '{version: $version, date: $date, size: ($size | tonumber), downloadURL: $downloadURL}') + jq --argjson newEntry "$NEW_ENTRY" '.apps[0].versions |= [$newEntry] + .' apps/expo/app-repo.json > temp.json && mv temp.json apps/expo/app-repo.json + + - uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: "chore: update app-repo.json" \ No newline at end of file diff --git a/apps/expo/app-repo.json b/apps/expo/app-repo.json index ea206809..25d4f942 100644 --- a/apps/expo/app-repo.json +++ b/apps/expo/app-repo.json @@ -1,5 +1,5 @@ { - "name": "movie-web native apps", + "name": "movie-web", "apps": [ { "name": "movie-web", @@ -10,14 +10,7 @@ "localizedDescription": "This service works by displaying video files from third-party providers inside an intuitive and aesthetic user interface.", "subtitle": "A small app for watching movies and shows easily", "tintColor": "a87fd1", - "versions": [ - { - "version": "", - "date": "", - "downloadURL": "https://github.com/movie-web/native-app/releases/latest/download/movie-web.ipa", - "size": 0 - } - ], + "versions": [], "appPermissions": {} } ],