Skip to content

Commit

Permalink
ci: upload updater bundle and signature (#40)
Browse files Browse the repository at this point in the history
* try to fix workflows

* workflow test
  • Loading branch information
Broken-Deer authored Aug 26, 2024
1 parent a7ba3f0 commit aef84d7
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 153 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ jobs:
name: AppImage bundle(aarch64)
path: ${{ github.workspace }}/core/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_aarch64.AppImage

- name: Upload updater signature
uses: actions/upload-artifact@v4
with:
name: Updater signature(aarch64-appimage)
path: ${{ github.workspace }}/core/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_aarch64.AppImage.sig

build-other:
needs: [get-version]
permissions:
Expand Down Expand Up @@ -115,9 +121,15 @@ jobs:

- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: yarn install # change this to npm or pnpm depending on which one you use.

- name: Build the app
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
yarn tauri build -- ${{ matrix.args }}
- name: show files
Expand Down Expand Up @@ -146,23 +158,58 @@ jobs:
name: AppImage bundle(amd64)
path: ${{ github.workspace }}/core/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_amd64.AppImage

- name: Upload appimage updater signature
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-22.04'
with:
name: Updater signature(amd64-appimage)
path: ${{ github.workspace }}/core/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_amd64.AppImage.sig

- name: Upload Microsoft Installer bundle
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: Microsoft Installer bundle(64-bit)
path: ${{ github.workspace }}/core/target/release/bundle/msi/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64_en-US.msi

- name: Upload Microsoft Installer bundle
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: Updater signature(64-bit-msi)
path: ${{ github.workspace }}/core/target/release/bundle/msi/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64_en-US.msi.sig

- name: Upload NSIS bundle
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: NSIS bundle(64-bit)
path: ${{ github.workspace }}/core/target/release/bundle/nsis/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64-setup.exe

- name: Upload NSIS updater signature
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: Updater signature(64-bit-nsis)
path: ${{ github.workspace }}/core/target/release/bundle/nsis/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64-setup.exe.sig

- name: Upload dmg bundle
uses: actions/upload-artifact@v4
if: matrix.platform == 'macos-latest'
with:
name: MacOS ${{ matrix.arch }} bundle(dmg)
path: ${{ github.workspace }}/core/target/${{matrix.target}}-apple-darwin/release/bundle/dmg/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_${{ matrix.arch }}.dmg

- name: Upload macos updater bundle
uses: actions/upload-artifact@v4
if: matrix.platform == 'macos-latest'
with:
name: MacOS ${{ matrix.arch }} updater bundle
path: ${{ github.workspace }}/core/target/${{matrix.target}}-apple-darwin/release/bundle/macos/amethyst-launcher.app.tar.gz

- name: Upload macos updater signature
uses: actions/upload-artifact@v4
if: matrix.platform == 'macos-latest'
with:
name: MacOS ${{ matrix.arch }} updater signature
path: ${{ github.workspace }}/core/target/${{matrix.target}}-apple-darwin/release/bundle/macos/amethyst-launcher.app.tar.gz.sig
3 changes: 3 additions & 0 deletions core/src/install/fabric/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use crate::{folder::MinecraftLocation, version::Version};
use log::info;
use tauri_plugin_http::reqwest;

/// Save fabric version.json
///
/// Note: You'll need to recheck the library integrity before launching the game.
pub async fn install(
mcversion: &str,
quilt_version: &str,
Expand Down
2 changes: 1 addition & 1 deletion core/src/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn install(storage: tauri::State<'_, Storage>) -> std::result::Result<
Progress {
completed: 0,
total: 0,
step: 1,
step: 1, // Step 1 is get version info
},
)
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions core/src/install/quilt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl QuiltVersionList {
}
}

/// Save the quilt `version.json`
pub async fn install(
mcversion: &str,
quilt_version: &str,
Expand Down
2 changes: 2 additions & 0 deletions core/src/install/vanilla/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub async fn generate_assets_downloads(

const LOF4J2_CONFIGURATION: &[u8] = include_bytes!("./log4j2.xml");

/// Save the log4j2 configuration file
pub async fn generate_log4j2_configuration_file(
version: &ResolvedVersion,
minecraft_location: &MinecraftLocation,
Expand All @@ -84,6 +85,7 @@ pub async fn generate_log4j2_configuration_file(
Ok(())
}

/// Get all the files you need to download
pub async fn generate_download_info(
version_id: &str,
minecraft_location: MinecraftLocation,
Expand Down
2 changes: 2 additions & 0 deletions core/src/instance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ async fn scan() -> anyhow::Result<Vec<Instance>> {
}

#[tauri::command]
/// The program use a global storage to store the current instance. TODO: remove it
// TODO: remove it to support global search or commands
pub fn set_current_instance(instance_name: String, storage: tauri::State<Storage>) {
let mut current_instance = storage.current_instance.lock().unwrap();
debug!("Selected {}", instance_name);
Expand Down
19 changes: 8 additions & 11 deletions core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,14 @@ async fn main() {
if window.label() != "main" {
return;
};
match event {
tauri::WindowEvent::CloseRequested { .. } => {
match std::fs::remove_dir_all(&DATA_LOCATION.get().unwrap().temp) {
Ok(_) => info!("Temporary files cleared"),
Err(_) => {
error!("Could not clear temp foler")
}
};
window.close().unwrap();
}
_ => {}
if let tauri::WindowEvent::CloseRequested { .. } = event {
match std::fs::remove_dir_all(&DATA_LOCATION.get().unwrap().temp) {
Ok(_) => info!("Temporary files cleared"),
Err(_) => {
error!("Could not clear temp foler")
}
};
window.close().unwrap();
}
})
.run(tauri::generate_context!())
Expand Down
111 changes: 55 additions & 56 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="dark" />
<title>Amethyst Launcher</title>
<link rel="stylesheet" href="./src/assets/styles/main.css" />
<link rel="stylesheet" href="./src/assets/styles/icons.css" />
<link rel="stylesheet" href="./src/assets/styles/transitions.css" />
<!-- Default themes -->
<link rel="stylesheet" href="./src/assets/styles/dark-theme.css" />
<link rel="stylesheet" href="./src/assets/styles/high-contrast-dark.css" />
<link rel="stylesheet" href="./src/assets/styles/light-theme.css" />
<style>
body {
}
</style>
</head>

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="dark" />
<title>Amethyst Launcher</title>
<link rel="stylesheet" href="./src/assets/styles/main.css" />
<link rel="stylesheet" href="./src/assets/styles/icons.css" />
<link rel="stylesheet" href="./src/assets/styles/transitions.css" />
<!-- Default themes -->
<link rel="stylesheet" href="./src/assets/styles/dark-theme.css" />
<link rel="stylesheet" href="./src/assets/styles/high-contrast-dark.css" />
<link rel="stylesheet" href="./src/assets/styles/light-theme.css" />
<style>
body {}
</style>
</head>

<body style="transform: scale(0.93); opacity: 0">
<!-- <div id="window" style="position: relative; transform: scale(0.92); opacity: 0; outline: 1px solid #f00;" data-tauri-drag-region> -->
<div id="window" data-tauri-drag-region></div>
<script type="module" src="./src/bootstrap.ts"></script>
<!-- <div class="ball-a"></div> -->
<!-- <div class="ball-b"></div> -->
<style id="fix-webkitgtk"></style>
<script></script>
<div id="model-shadow"></div>
<style>
#model-shadow {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #00000079;
z-index: -1;
transition: all 0.3s ease;
opacity: 0;
}
</style>
<style id="no-animations">
.no-animations * {
animation: none !important;
transition: none !important;
}
</style>
<script>
document.onkeydown = (event) => {
if (window.event && window.event.keyCode == 123) {
event.keyCode = 0
event.returnValue = false
<body style="transform: scale(0.93); opacity: 0">
<!-- <div id="window" style="position: relative; transform: scale(0.92); opacity: 0; outline: 1px solid #f00;" data-tauri-drag-region> -->
<div id="window" data-tauri-drag-region></div>
<script type="module" src="./src/bootstrap.ts"></script>
<!-- <div class="ball-a"></div> -->
<!-- <div class="ball-b"></div> -->
<style id="fix-webkitgtk"></style>
<script></script>
<div id="model-shadow"></div>
<style>
#model-shadow {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #00000079;
z-index: -1;
transition: all 0.3s ease;
opacity: 0;
}
if (window.event && window.event.keyCode == 13) {
window.event.keyCode = 505
</style>
<style id="no-animations">
.no-animations * {
animation: none !important;
transition: none !important;
}
</style>
<script>
document.onkeydown = (event) => {
if (window.event && window.event.keyCode == 123) {
event.keyCode = 0
event.returnValue = false
}
if (window.event && window.event.keyCode == 13) {
window.event.keyCode = 505
}
}
}
// 禁止右键
// document.oncontextmenu = function (event) {
// if (window.event) {
Expand All @@ -76,7 +76,6 @@
// return false
// }
// }
</script>
</body>

</script>
</body>
</html>
42 changes: 21 additions & 21 deletions src/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createApp, watch } from "vue";
import { createPinia } from "pinia";
import App from "./Main.vue";
import { event } from "@tauri-apps/api";
import { createI18n } from "vue-i18n";
import en_us from "./i18n/en_us";
import zh_cn from "./i18n/zh_cn";
import ru_ru from "./i18n/ru_ru";
import { createApp, watch } from "vue"
import { createPinia } from "pinia"
import App from "./Main.vue"
import { event } from "@tauri-apps/api"
import { createI18n } from "vue-i18n"
import en_us from "./i18n/en_us"
import zh_cn from "./i18n/zh_cn"
import ru_ru from "./i18n/ru_ru"

const pinia = createPinia();
const pinia = createPinia()
const i18n = createI18n({
legacy: false,
locale: "zh_cn",
Expand All @@ -17,14 +17,14 @@ const i18n = createI18n({
zh_cn,
ru_ru,
},
});
const app = createApp(App);
})
const app = createApp(App)

app.use(pinia);
app.use(i18n);
app.use(pinia)
app.use(i18n)

app.mount("#window");
import $ from "jquery";
app.mount("#window")
import $ from "jquery"

// // window.getCurrent().setAlwaysOnTop(true)
// // window.getCurrent().setResizable(false)
Expand Down Expand Up @@ -57,13 +57,13 @@ globalThis.onload = () => {
███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║███████╗██║ ██║
╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
`);
event.emit("fontend-loaded");
`)
event.emit("fontend-loaded")
$("body").attr(
"style",
"transform: scale(1); opacity: 1;transition: all 250ms cubic-bezier(0, 0.74, 0.65, 1); ",
);
)
setTimeout(() => {
$("body").attr("style", "");
}, 500);
};
$("body").attr("style", "")
}, 500)
}
5 changes: 4 additions & 1 deletion src/components/Instances.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<div class="instances">
<div class="overview">
<div class="instance" @click="$emit('select', instance)" v-for="instance in computedInstances"
<div
class="instance"
@click="$emit('select', instance)"
v-for="instance in computedInstances"
:key="instance.config.name">
<img src="@/assets/images/minecraft-icon.svg" />
<div class="title">
Expand Down
7 changes: 1 addition & 6 deletions src/components/SettingGroup.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<template>
<div class="setting-group">
<p v-if="title" style="margin-bottom: 10px; padding-left: 8px">{{ title }}</p>
<div
style="
overflow: hidden;
border-radius: 8px;
margin-bottom: 16px;
">
<div style="overflow: hidden; border-radius: 8px; margin-bottom: 16px">
<slot></slot>
</div>
</div>
Expand Down
Loading

0 comments on commit aef84d7

Please sign in to comment.