From 433401229d93549a1bd274455fb01ce2b083d15d Mon Sep 17 00:00:00 2001 From: EDM115 Date: Sat, 18 May 2024 16:14:42 +0200 Subject: [PATCH] feat: uses the actual URL's in the Readme and in app.html, auto fetches the latest action build --- README.md | 4 ++-- package.json | 2 +- src/app.html | 2 +- src/lib/links.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2268797..17b2552 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ Powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/package ## Running locally ```bash -git clone https://github.com/Pdawg-bytes/rectify11-website.git -cd rectify11-website +git clone https://github.com/Rectify11/Website.git +cd Website npm install npm run dev -- --open ``` diff --git a/package.json b/package.json index b20474d..f1e7f3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rectify11-website", - "version": "0.0.1", + "version": "0.0.2", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/src/app.html b/src/app.html index e1c9cf3..9be4a41 100644 --- a/src/app.html +++ b/src/app.html @@ -7,7 +7,7 @@ - + %sveltekit.head% diff --git a/src/lib/links.ts b/src/lib/links.ts index 7e8edf3..b652883 100644 --- a/src/lib/links.ts +++ b/src/lib/links.ts @@ -1,3 +1,3 @@ -export const gitHubLink = "https://github.com/Rectify11/Installer/releases"; +export const gitHubLink = "javascript:(async () => {const repoOwner = 'Rectify11'; const repoName = 'Installer'; const workflowFileName = 'build.yml'; try {const runsResponse = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/actions/workflows/${workflowFileName}/runs`); const runsData = await runsResponse.json(); const latestSuccessfulRun = runsData.workflow_runs.find(run => run.conclusion === 'success'); if (!latestSuccessfulRun) throw new Error('No successful runs found'); const artifactsResponse = await fetch(latestSuccessfulRun.artifacts_url); const artifactsData = await artifactsResponse.json(); const latestArtifact = artifactsData.artifacts[0]; if (!latestArtifact) throw new Error('No artifacts found for the latest successful run'); window.location.href = `https://github.com/${repoOwner}/${repoName}/actions/runs/${latestArtifact.workflow_run.id}/artifacts/${latestArtifact.id}`; } catch (error) { console.error('Error fetching artifact:', error); alert('Failed to fetch the latest artifact. See console for details.'); } })()"; export const gitHubSrcLink = "https://github.com/Rectify11/Installer"; export const discordLink = "https://discord.gg/rectify11-community-1077324213142175744"; \ No newline at end of file