Skip to content

Commit

Permalink
chore: test: fix missing env & upload to release
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko233 committed Nov 25, 2023
1 parent b09331e commit 9e2ae31
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/macos-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ jobs:
pnpm i
pnpm check --arch arm64 --sidecar-host aarch64-apple-darwin
- name: Tauri build (cmd)
- name: Tauri build with Upload (cmd)
env:
TAG_NAME: dev
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
run: |
pnpm build --target aarch64-apple-darwin
mv ./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Clash Nyanpasu.app ./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Clash Nyanpasu.aarch64.app
mv ./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Clash Nyanpasu.app.tar.gz ./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Clash Nyanpasu.aarch64.app.tar.gz
node scripts/osx-aarch64-upload.mjs
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"web:dev": "vite",
"web:build": "tsc && vite build",
"web:serve": "vite preview",
"aarch": "node scripts/aarch.mjs",
"check": "node scripts/check.mjs",
"updater": "node scripts/updater.mjs",
"publish": "node scripts/publish.mjs",
Expand Down
24 changes: 7 additions & 17 deletions scripts/aarch.mjs → scripts/osx-aarch64-upload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
*/
import fs from "fs-extra";
import path from "path";
import { exit } from "process";
import { execSync } from "child_process";
import { createRequire } from "module";
import { getOctokit, context } from "@actions/github";

Expand All @@ -15,9 +13,6 @@ async function resolve() {
if (!process.env.GITHUB_TOKEN) {
throw new Error("GITHUB_TOKEN is required");
}
if (!process.env.GITHUB_REPOSITORY) {
throw new Error("GITHUB_REPOSITORY is required");
}
if (!process.env.TAURI_PRIVATE_KEY) {
throw new Error("TAURI_PRIVATE_KEY is required");
}
Expand All @@ -27,15 +22,15 @@ async function resolve() {

const { version } = require("../package.json");

const buildCmd = `pnpm build -f default-meta`;

console.log(`[INFO]: Upload to tag "${tag}"`);
console.log(`[INFO]: Building app. "${buildCmd}"`);
const tag = process.env.TAG_NAME || `v${version}`;

execSync(buildCmd);
console.log(`[INFO]: Upload to tag ${tag}`);

const cwd = process.cwd();
const bundlePath = path.join(cwd, "src-tauri/target/release/bundle");
const bundlePath = path.join(
cwd,
"src-tauri/target/aarch64-apple-darwin/release/bundle"
);
const join = (p) => path.join(bundlePath, p);

const appPathList = [
Expand Down Expand Up @@ -105,9 +100,4 @@ async function uploadAssets(releaseId, assets) {
}
}

if (process.platform === "darwin" && process.arch === "arm64") {
resolve();
} else {
console.error("invalid");
exit(1);
}
resolve();

0 comments on commit 9e2ae31

Please sign in to comment.