-
-
Notifications
You must be signed in to change notification settings - Fork 94
Resolve packaging problems #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
93d10a2
8c438bc
724288f
9b13b8e
7b3af1d
94233f1
d704b9f
14fcc2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [toolchain] | ||
| channel = "1.91.1" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,29 +5,28 @@ import url from "url"; | |
| const __filename = url.fileURLToPath(import.meta.url); | ||
| const __dirname = path.resolve(__filename, "../.."); | ||
|
|
||
| async function generateReleaseData() { | ||
| async function generateReleaseData(version) { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing HTTP call (every time) just to build the binary every time is quite painful for any distribution (since builds may only pre-fetch locked libraries and then perform the build in isolation) thus switched to explicitly passing the version here and statically generating metadata. This also provides determinism (builds should not differ on the time of the build, which currently is possible since to |
||
| try { | ||
| const response = await fetch( | ||
| "https://api.github.com/repos/zmkfirmware/zmk-studio/releases/latest", | ||
| { | ||
| headers: process.env.GITHUB_TOKEN | ||
| ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } | ||
| : {}, | ||
| }, | ||
| ); | ||
| if (!response.ok) { | ||
| throw new Error(`HTTP error! status: ${response.status}`); | ||
| } | ||
|
|
||
| const data = await response.json(); | ||
| const dataFilePath = path.resolve( | ||
| __dirname, | ||
| "src", | ||
| "data", | ||
| "release-data.json", | ||
| ); | ||
| await fs.mkdir(path.dirname(dataFilePath), { recursive: true }); | ||
| await fs.writeFile(dataFilePath, JSON.stringify(data)); | ||
|
|
||
| await fs.writeFile(dataFilePath, JSON.stringify({ | ||
| version: `v${version}`, | ||
| assets: [ | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio-${version}-1.x86_64.rpm`, | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio_${version}_amd64.AppImage`, | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio_${version}_amd64.deb`, | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio_${version}_universal.dmg`, | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio_${version}_x64-setup.exe`, | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio_${version}_x64_en-US.msi`, | ||
| `https://github.com/zmkfirmware/zmk-studio/releases/download/v${version}/ZMK.Studio_universal.app.tar.gz`, | ||
| ] | ||
| })); | ||
|
|
||
| console.log("Release data generated successfully!"); | ||
| } catch (error) { | ||
|
|
@@ -36,4 +35,9 @@ async function generateReleaseData() { | |
| } | ||
| } | ||
|
|
||
| generateReleaseData(); | ||
| const argv = process.argv.slice(2) | ||
| if (argv.length < 1) { | ||
| console.error("No version wasd specified for version data generation"); | ||
| process.exit(1); | ||
| } | ||
| generateReleaseData(argv[0]); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regenerated to version 3