Merge pull request #39 from xTVaser/v/update-release-meta-file

This commit is contained in:
Tyler Wilding 2022-05-01 00:42:09 -04:00 committed by GitHub
commit 09e72827db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 103 additions and 10 deletions

View file

@ -2,7 +2,6 @@ import { Octokit } from "@octokit/rest";
import { throttling } from "@octokit/plugin-throttling";
import { retry } from "@octokit/plugin-retry";
import * as fs from "fs";
import * as path from "path";
Octokit.plugin(throttling);
Octokit.plugin(retry);
@ -36,12 +35,58 @@ const octokit = new Octokit({
},
});
let releaseId = process.env.RELEASE_ID;
const { data: releaseData } = await octokit.rest.repos.getRelease({
let tagToSearchFor = process.env.TAG_VALUE.split("refs/tags/")[1];
const { data: recentReleases } = await octokit.rest.repos.listReleases({
owner: "open-goal",
repo: "launcher",
release_id: releaseId,
per_page: 100,
});
// does the tauri action auto take it out of draft?
// gotta test...
let release = undefined;
for (var i = 0; i < recentReleases.length; i++) {
if (recentReleases[i].tag_name == tagToSearchFor) {
release = recentReleases[i];
break;
}
}
if (release === undefined) {
console.log(`Could not find release with tag name: ${tagToSearchFor}`);
process.exit(1);
}
// TODO - no macOS yet
const releaseMeta = {
name: release.tag_name,
notes: "UPDATE",
pub_date: release.created_at,
platforms: {
linux: {
signature: "",
url: `https://github.com/open-goal/launcher/releases/download/${
release.tag_name
}/opengoal-launcher_${tagToSearchFor.replace(
"v",
""
)}_amd64.AppImage.tar.gz`,
},
win64: {
signature: "",
url: `https://github.com/open-goal/launcher/releases/download/${
release.tag_name
}/opengoal-launcher_${tagToSearchFor.replace("v", "")}_x64_en-US.msi.zip`,
},
},
};
fs.writeFileSync(
"./.tauri/latest-release.json",
JSON.stringify(releaseMeta, null, 2)
);
await octokit.rest.repos.updateRelease({
owner: "open-goal",
repo: "launcher",
release_id: release.id,
draft: false,
});

View file

@ -44,5 +44,5 @@ jobs:
default_author: github_actor
author_name: "OpenGOALBot"
author_email: "OpenGOALBot@users.noreply.github.com"
message: "Bump to version - ${{ steps.version-bump.outputs.new_version }}"
message: "release: bump to version - ${{ steps.version-bump.outputs.new_version }}"
tag: "v${{ steps.version-bump.outputs.new_version }}"

View file

@ -94,7 +94,42 @@ jobs:
tagName: "v__VERSION__"
releaseName: "OpenGOAL Launcher v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true # TODO - when we are ready to go live, make them non draft
releaseDraft: true
prerelease: false
# TODO - update a json file in the repo that will allow auto-updating, change the repo to release
update-release-meta:
if: github.repository == 'open-goal/launcher'
needs: publish-tauri
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.BOT_PAT }}
ref: main
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: update release metadata and publish the release
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
TAG_VALUE: ${{ github.REF }}
run: |
pushd ./.github/scripts/update-release-metadata
npm ci
popd
node ./.github/scripts/update-release-metadata/index.js
- name: commit release metadata change
uses: EndBug/add-and-commit@v8
with:
default_author: github_actor
author_name: "OpenGOALBot"
author_email: "OpenGOALBot@users.noreply.github.com"
message: "release: update release metadata to latest"

View file

@ -28,3 +28,16 @@ We are using Tauri to build a native app, but still with simple Web technology.
- `npm run tauri dev`
This builds the app with Tauri (this is a rust compilation, the first run will take a while) and the frontend is served via Vite -- a nice web server that will hot-reload any changes as you develop.
## Release Process
```mermaid
sequenceDiagram
jak-project->>jak-project: New tag is manually cut and built
jak-project->>launcher: Repository Dispatch to start release
launcher->>launcher: Alternatively, manually triggered release here
launcher->>launcher: Build App for all supported platforms
launcher->>launcher: Publish release and update latest release metadata file in repo
website->>GitHub API: Website will display latest release
app->>launcher: Detect new version and will prompt the user to update
```

View file

@ -16,7 +16,7 @@ export async function filePrompt(title) {
const path = await open({
multiple: false,
directory: false,
filters: [{ extensions: ["ISO"], name: "Jak ISO File" }],
filters: [{ extensions: ["ISO", "iso"], name: "Jak ISO File" }],
});
if (path) {

0
third-party/glew_2.1.0/linux/glewinfo vendored Normal file → Executable file
View file