mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-07 05:46:39 +00:00
feat: add release
This commit is contained in:
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
@@ -4,9 +4,16 @@ name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
# push:
|
||||
# branches: [ "main" ]
|
||||
# pull_request:
|
||||
# branches: [ "main" ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -14,7 +21,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
||||
- name: Set env
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
@@ -27,3 +37,14 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
run: ./build.sh
|
||||
|
||||
- uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
|
||||
prerelease: false
|
||||
title: "Automatic Build"
|
||||
files: |
|
||||
LICENSE
|
||||
README.md
|
||||
tapemanager-linux-amd64-${{ env.RELEASE_VERSION }}.tar.gz
|
||||
|
||||
4
build.sh
4
build.sh
@@ -10,8 +10,12 @@ mkdir -p output;
|
||||
cp -r scripts ./output/;
|
||||
cp ./cmd/tape-httpd/tape-writer.service ./output/
|
||||
cp ./cmd/tape-httpd/config.example.yaml ./output/
|
||||
cp ./LICENSE ./output/
|
||||
cp ./README.md ./output/
|
||||
|
||||
# docker run --rm -v $(pwd):/app golang:1.21 sh -c "cd /app && bash "
|
||||
# docker run --rm -v $(pwd):/app node:20-slim sh -c "cd /app && bash build_frontend.sh"
|
||||
./build_backend.sh
|
||||
./build_frontend.sh
|
||||
|
||||
tar -czvf tapemanager-linux-amd64-${RELEASE_VERSION}.tar.gz ./output/*
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
"gen-proto": "protoc --ts_out ./src/entity --proto_path ../entity/ `ls ../entity/*.proto` && ./src/entity/gen_index.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aperturerobotics/chonky": "^0.2.6",
|
||||
"@aperturerobotics/chonky-icon-fontawesome": "^0.2.2",
|
||||
"@emotion/react": "^11.10.4",
|
||||
"@emotion/styled": "^11.10.4",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
||||
@@ -23,8 +25,6 @@
|
||||
"@protobuf-ts/grpcweb-transport": "^2.8.2",
|
||||
"@protobuf-ts/runtime": "^2.8.2",
|
||||
"@protobuf-ts/runtime-rpc": "^2.8.2",
|
||||
"chonky": "^2.3.2",
|
||||
"chonky-icon-fontawesome": "^2.3.2",
|
||||
"fast-text-encoding": "^1.0.6",
|
||||
"filesize": "^10.0.5",
|
||||
"format-duration": "^2.0.0",
|
||||
@@ -40,15 +40,15 @@
|
||||
"sort-by": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@protobuf-ts/plugin": "^2.8.2",
|
||||
"@types/node": "^18.11.14",
|
||||
"@types/react": "^18.0.17",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
"@vitejs/plugin-react": "^2.1.0",
|
||||
"@protobuf-ts/plugin": "^2.9.1",
|
||||
"@types/node": "^20.7.0",
|
||||
"@types/react": "^18.2.22",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@vitejs/plugin-react": "^4.1.0",
|
||||
"less": "^4.1.3",
|
||||
"prettier": "2.7.1",
|
||||
"prettier": "^3.0.3",
|
||||
"tsdef": "^0.0.14",
|
||||
"typescript": "^4.6.4",
|
||||
"vite": "^3.1.0"
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FileData, FileArray, FileAction } from "chonky";
|
||||
import { defineFileAction } from "chonky";
|
||||
import { ChonkyActions } from "chonky";
|
||||
import { FileData, FileArray, FileAction } from "@aperturerobotics/chonky";
|
||||
import { defineFileAction } from "@aperturerobotics/chonky";
|
||||
import { ChonkyActions } from "@aperturerobotics/chonky";
|
||||
|
||||
type RenameFileState = {
|
||||
contextMenuTriggerFile: FileData;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FileData } from "chonky";
|
||||
import { FileData } from "@aperturerobotics/chonky";
|
||||
import { GrpcWebFetchTransport } from "@protobuf-ts/grpcweb-transport";
|
||||
import { ServiceClient, File, SourceFile } from "./entity";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { setChonkyDefaults } from "chonky";
|
||||
import { ChonkyIconFA } from "chonky-icon-fontawesome";
|
||||
import { setChonkyDefaults } from "@aperturerobotics/chonky";
|
||||
import { ChonkyIconFA } from "@aperturerobotics/chonky-icon-fontawesome";
|
||||
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faPencilAlt } from "@fortawesome/free-solid-svg-icons/faPencilAlt";
|
||||
@@ -27,5 +27,5 @@ import { unstable_ClassNameGenerator as ClassNameGenerator } from "@mui/material
|
||||
|
||||
ClassNameGenerator.configure(
|
||||
// Do something with the componentName
|
||||
(componentName: string) => `app-${componentName}`
|
||||
(componentName: string) => `app-${componentName}`,
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@ import { useState, useEffect, useMemo, useCallback, FC, useRef, RefObject } from
|
||||
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Box from "@mui/material/Box";
|
||||
import { FileBrowser, FileNavbar, FileToolbar, FileList, FileContextMenu, FileArray, FileBrowserHandle } from "chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData, FileData } from "chonky";
|
||||
import { FileBrowser, FileNavbar, FileToolbar, FileList, FileContextMenu, FileArray, FileBrowserHandle } from "@aperturerobotics/chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData, FileData } from "@aperturerobotics/chonky";
|
||||
|
||||
import { cli, convertSourceFiles } from "../api";
|
||||
import { Root } from "../api";
|
||||
@@ -53,7 +53,7 @@ const useBackupSourceBrowser = (source: RefObject<FileBrowserHandle>) => {
|
||||
return;
|
||||
}
|
||||
},
|
||||
[openFolder, source]
|
||||
[openFolder, source],
|
||||
);
|
||||
|
||||
const fileActions = useMemo(() => [ChonkyActions.StartDragNDrop, RefreshListAction], []);
|
||||
@@ -129,7 +129,7 @@ const useBackupTargetBrowser = () => {
|
||||
return;
|
||||
}
|
||||
},
|
||||
[files, setFiles]
|
||||
[files, setFiles],
|
||||
);
|
||||
|
||||
const fileActions = useMemo(() => [ChonkyActions.DeleteFiles, AddFileAction, CreateBackupJobAction], []);
|
||||
|
||||
@@ -2,8 +2,8 @@ import { useState, useRef, useEffect, useMemo, useCallback } from "react";
|
||||
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Box from "@mui/material/Box";
|
||||
import { FullFileBrowser, FileBrowserProps, FileBrowserHandle, FileArray } from "chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData } from "chonky";
|
||||
import { FullFileBrowser, FileBrowserProps, FileBrowserHandle, FileArray } from "@aperturerobotics/chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData } from "@aperturerobotics/chonky";
|
||||
|
||||
import { cli, convertFiles } from "../api";
|
||||
import { Root } from "../api";
|
||||
@@ -24,7 +24,7 @@ const useDualSide = () => {
|
||||
return;
|
||||
}
|
||||
return ref.current.requestFileAction(RefreshListAction, {});
|
||||
})
|
||||
}),
|
||||
);
|
||||
}, [instances]);
|
||||
|
||||
@@ -148,7 +148,7 @@ const useFileBrowser = (storageKey: string, refreshAll: () => Promise<void>, ope
|
||||
return;
|
||||
}
|
||||
},
|
||||
[openFolder, openDetailModel, refreshAll, currentID]
|
||||
[openFolder, openDetailModel, refreshAll, currentID],
|
||||
);
|
||||
|
||||
const fileActions = useMemo(() => [ChonkyActions.CreateFolder, ChonkyActions.DeleteFiles, ChonkyActions.MoveFiles, RenameFileAction, RefreshListAction], []);
|
||||
|
||||
@@ -2,8 +2,8 @@ import { useState, useEffect, useMemo, useCallback, FC, useRef, RefObject } from
|
||||
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Box from "@mui/material/Box";
|
||||
import { FileBrowser, FileNavbar, FileToolbar, FileList, FileContextMenu, FileArray, FileBrowserHandle } from "chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData, FileData } from "chonky";
|
||||
import { FileBrowser, FileNavbar, FileToolbar, FileList, FileContextMenu, FileArray, FileBrowserHandle } from "@aperturerobotics/chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData, FileData } from "@aperturerobotics/chonky";
|
||||
|
||||
import { cli, convertFiles } from "../api";
|
||||
import { Root } from "../api";
|
||||
@@ -62,7 +62,7 @@ const useRestoreSourceBrowser = (source: RefObject<FileBrowserHandle>) => {
|
||||
return;
|
||||
}
|
||||
},
|
||||
[openFolder, source, folderChain]
|
||||
[openFolder, source, folderChain],
|
||||
);
|
||||
|
||||
const fileActions = useMemo(() => [ChonkyActions.StartDragNDrop, RefreshListAction], []);
|
||||
@@ -113,7 +113,7 @@ const useRestoreTargetBrowser = () => {
|
||||
return;
|
||||
}
|
||||
},
|
||||
[files, setFiles]
|
||||
[files, setFiles],
|
||||
);
|
||||
|
||||
const fileActions = useMemo(() => [ChonkyActions.DeleteFiles, AddFileAction, CreateRestoreJobAction], []);
|
||||
|
||||
@@ -3,8 +3,8 @@ import moment from "moment";
|
||||
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Box from "@mui/material/Box";
|
||||
import { FileBrowser, FileNavbar, FileToolbar, FileList, FileContextMenu, FileArray, FileBrowserHandle } from "chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData, FileData } from "chonky";
|
||||
import { FileBrowser, FileNavbar, FileToolbar, FileList, FileContextMenu, FileArray, FileBrowserHandle } from "@aperturerobotics/chonky";
|
||||
import { ChonkyActions, ChonkyFileActionData, FileData } from "@aperturerobotics/chonky";
|
||||
|
||||
import { cli, Root } from "../api";
|
||||
import { TapeListRequest, Source, Tape } from "../entity";
|
||||
@@ -72,7 +72,7 @@ const useTapesSourceBrowser = (source: RefObject<FileBrowserHandle>) => {
|
||||
return;
|
||||
}
|
||||
},
|
||||
[openFolder, source, folderChain]
|
||||
[openFolder, source, folderChain],
|
||||
);
|
||||
|
||||
const fileActions = useMemo(() => [ChonkyActions.DeleteFiles], []);
|
||||
|
||||
@@ -9,7 +9,7 @@ export const hexEncode = (buf: string) => {
|
||||
};
|
||||
|
||||
export const formatFilesize = (size: number | bigint): string =>
|
||||
filesize(size, {
|
||||
filesize(size as any as number, {
|
||||
base: 2,
|
||||
standard: "jedec",
|
||||
}) as string;
|
||||
|
||||
Reference in New Issue
Block a user