Skip to content

Commit e2842f4

Browse files
authored
Added update apps github workflow
Updated authorLink to authorUrl Update apps in preview mode only executes when CHECK_APPS is set
1 parent 3a649c4 commit e2842f4

14 files changed

+47
-17
lines changed

.github/workflows/update.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Update Apps
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
push:
7+
paths:
8+
- 'apps/**'
9+
10+
jobs:
11+
update_apps:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Install Deno
17+
uses: denoland/setup-deno@v1
18+
with:
19+
deno-version: v1.x
20+
21+
- name: Get changed files
22+
id: get_changed_files
23+
run: echo '::set-output name=files::$(git diff-tree --no-commit-id --name-only -r HEAD | grep -v "\.json$" | xargs -n1 basename | tr "\n" " ")'
24+
if: ${{ github.event_name == 'push' }}
25+
26+
- name: Update Apps
27+
run: deno run --allow-net --unstable-kv update:apps ${{ steps.get_changed_files.outputs.files }}
28+
env:
29+
DENO_KV_TOKEN: ${{ secrets.DENO_KV_TOKEN }}
30+
DENO_KV_NAMESPACE: ${{ secrets.DENO_KV_NAMESPACE }}

apps/chrome.apps.canvas.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"entertainment"
1111
],
1212
"author": "Google",
13-
"authorLink": "https://about.google",
13+
"authorUrl": "https://about.google",
1414
"accentColor": "#ec4434",
1515
"version": 2
1616
}

apps/com.bundlejs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"development"
1515
],
1616
"author": "@okikio",
17-
"authorLink": "https://okikio.dev/",
17+
"authorUrl": "https://okikio.dev/",
1818
"accentColor": "#3c84f4",
1919
"version": 2
2020
}

apps/com.spotify.open.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"music"
1212
],
1313
"author": "Spotify",
14-
"authorLink": "https://spotify.com",
14+
"authorUrl": "https://spotify.com",
1515
"accentColor": "#1cd363",
1616
"version": 2
1717
}

apps/dev.jull.sudoku.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"games"
1212
],
1313
"author": "jull.dev",
14-
"authorLink": "https://jull.dev",
14+
"authorUrl": "https://jull.dev",
1515
"accentColor": "#7f7f7f",
1616
"version": 2
1717
}

apps/dev.vscode.insiders.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"development"
1313
],
1414
"author": "Microsoft",
15-
"authorLink": "https://microsoft.com/",
15+
"authorUrl": "https://microsoft.com/",
1616
"accentColor": "#0eb49c",
1717
"version": 2
1818
}

apps/dev.vscode.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"development"
1313
],
1414
"author": "Microsoft",
15-
"authorLink": "https://microsoft.com/",
15+
"authorUrl": "https://microsoft.com/",
1616
"accentColor": "#24adf4",
1717
"version": 2
1818
}

apps/org.eu.ciorogarla.431.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"url": "https://431.ciorogarla.eu.org",
44
"manifestUrl": "https://431.ciorogarla.eu.org/static/site.webmanifest",
55
"author": "Roseto",
6-
"authorLink": "https://roseto.co",
6+
"authorUrl": "https://roseto.co",
77
"categories": ["tools"],
88
"features": ["openSource", "mobile", "desktop"],
99
"version": 5

apps/org.eu.ciorogarla.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"social"
1414
],
1515
"author": "Roseto",
16-
"authorLink": "https://roseto.co",
16+
"authorUrl": "https://roseto.co",
1717
"certificateUrl": "https://ciorogarla.eu.org/.well-known/certificate.json",
1818
"accentColor": "#36c836",
1919
"version": 5

docs/app-spec.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ This URL points to the public repository of your app.
6666
This will include the categories that your app is included in.
6767
It is preferable to use the `categories` key in your app's manifest.
6868

69-
### `author` & `authorLink`
69+
### `author` & `authorUrl`
7070

7171
If you want to have a different author text from the one in your app's manifest,
72-
you can add an `author` key. You can also add `authorLink` to link to your
73-
website or GitHub profile.
72+
you can add an `author` key. You can also add `authorUrl` to link to your
73+
website or GitHub profile. (`authorUrl` has been previously known as `authorLink`)
7474

7575
### `accentColor`
7676

scripts/checkUpdates.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface AppSpec {
2323
categories?: string[];
2424
features: string[];
2525
author?: string;
26-
authorLink?: string;
26+
authorUrl?: string;
2727
githubUrl?: string;
2828
gitlabUrl?: string;
2929
accentColor?: string;
@@ -217,7 +217,7 @@ export const generateApp = async (appSpec: AppSpec, existingApp: App | null, man
217217
manifestHash: await digest(JSON.stringify(manifest)),
218218
githubUrl: appSpec.githubUrl || undefined,
219219
gitlabUrl: appSpec.gitlabUrl || undefined,
220-
authorLink: appSpec.authorLink || undefined,
220+
authorUrl: appSpec.authorUrl || undefined,
221221
}
222222

223223
const updatedApp = { ...existingApp, ...newApp } as App;

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ kv.listenQueue(async (value: unknown) => {
2323
if (!DEV) {
2424
Deno.cron("App updates", "0 0 */1 * *", updateApps);
2525
} else {
26-
updateApps();
26+
Deno.env.get("CHECK_APPS") && updateApps();
2727
}
2828

2929
// @ts-ignore: I don't care about the type of the manifest

src/routes/app/[id].tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ export default async function App(_: Request, ctx: RouteContext) {
7474
<h2 class="text-3xl">
7575
{app.name}
7676
</h2>
77-
{app.authorLink
77+
{app.authorUrl
7878
? (
7979
<a
80-
href={app.authorLink}
80+
href={app.authorUrl}
8181
rel="noopener noreferrer"
8282
target="_blank"
8383
class="opacity-50 hover:underline"

src/types/App.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface App {
1717
name: string;
1818

1919
author: string;
20-
authorLink?: string;
20+
authorUrl?: string;
2121

2222
url: string;
2323
manifestUrl: string;

0 commit comments

Comments
 (0)