Skip to content

Commit

Permalink
chore: adjust app repo and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
castdrian committed Mar 28, 2024
1 parent 0d730f0 commit 79220ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 37 deletions.
41 changes: 13 additions & 28 deletions .github/workflows/release-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
11 changes: 2 additions & 9 deletions apps/expo/app-repo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "movie-web native apps",
"name": "movie-web",
"apps": [
{
"name": "movie-web",
Expand All @@ -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": {}
}
],
Expand Down

0 comments on commit 79220ec

Please sign in to comment.