Skip to content
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

ci: add dev build ci #8

Merged
merged 34 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5f8a57c
ci: add dev build ci
SARDONYX-sard Oct 9, 2023
29d974a
ci: rename GUI ci name
SARDONYX-sard Oct 9, 2023
ed9f992
ci: add tag
SARDONYX-sard Oct 9, 2023
f401201
ci(dev): remove tag in changelog
SARDONYX-sard Oct 9, 2023
1ce4dce
ci(dev): remove changelog action
SARDONYX-sard Oct 9, 2023
b7f3dfd
ci(dev): attempt new changelog
SARDONYX-sard Oct 9, 2023
32db67b
ci(release): add if condition
SARDONYX-sard Oct 9, 2023
77301d0
ci(dev): add recreate tag action
SARDONYX-sard Oct 9, 2023
80b0302
ci(dev): change recreate tag action
SARDONYX-sard Oct 9, 2023
babf7c5
ci(dev): add `force` in recreate tag action
SARDONYX-sard Oct 9, 2023
4eb8be9
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
12208f8
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
5daf3c8
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
28246a7
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
8ec1e53
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
b088f4a
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
8a84b5f
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
6e11976
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
18b6103
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
3bf61b9
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
f328b00
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
3b90b63
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
776e2ee
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
5650f0b
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
9e917c7
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
b509e75
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
b4d5552
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
9abc035
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
83ef817
ci(dev): attempt recreate tag ci
SARDONYX-sard Oct 9, 2023
32d1eb0
ci(dev): revert changelog action
SARDONYX-sard Oct 9, 2023
0a86f6d
fix(front): fix css preset design
SARDONYX-sard Oct 9, 2023
d579782
feat(front-form): change help texts
SARDONYX-sard Oct 9, 2023
4ba13c5
ci(cli): change toolchain action
SARDONYX-sard Oct 9, 2023
d214689
fix(front): remove removed import
SARDONYX-sard Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/dev-release-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Development Release CLI

on:
push:
branches: ["development"]

jobs:
build:
name: Release binary
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: dar2oar
asset_name: dar2oar-x86_64-unknown-linux-gnu.tar.gz
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: dar2oar
asset_name: dar2oar-x86_64-unknown-linux-musl.tar.gz
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
artifact_name: dar2oar.exe
asset_name: dar2oar-x86_64-pc-windows-gnu.zip
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: dar2oar
asset_name: dar2oar-x86_64-apple-darwin.zip

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Without it, once created, the commit sha for the tag will not be updated.
- name: Recreate tag
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git tag "development" -m "Development version" --force
git push -f --tags
if: matrix.target == 'x86_64-pc-windows-gnu'

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Cross build with all features
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --all-features --verbose

- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
if: matrix.target == 'x86_64-pc-windows-gnu'

- name: Compress binary
run: |
if [[ "${{ matrix.target }}" == *"linux"* ]]; then
tar -czf ${{ matrix.asset_name }} target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
else
zip -r ${{ matrix.asset_name }} target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
fi

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
release_name: DAR to OAR Converter Development-${{ github.sha }}
body: ${{ steps.changelog.outputs.changes }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: "development"
prerelease: true
overwrite: true
65 changes: 65 additions & 0 deletions .github/workflows/dev-release-gui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Development Release GUI
on:
push:
branches:
- "development"
workflow_dispatch:

jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev

- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"

- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: Install frontend dependencies
run: npm install

- name: Sync node version and setup cache
uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-

- name: Build the app
uses: tauri-apps/tauri-action@v0

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseName: "DAR to OAR Converter Development-${{ github.sha }}" # tauri-action replaces \_\_VERSION\_\_ with the app version.
tagName: development
prerelease: true
4 changes: 2 additions & 2 deletions .github/workflows/release-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ jobs:
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true

- name: Cross build with all features
uses: actions-rs/cargo@v1
Expand All @@ -53,6 +52,7 @@ jobs:
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
if: matrix.target == 'x86_64-pc-windows-gnu'

- name: Compress binary
run: |
Expand Down
63 changes: 52 additions & 11 deletions frontend/src/components/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,15 @@ export function ConvertForm() {
};

return (
<Grid container component="form" onSubmit={handleSubmit(onSubmit)}>
<Grid
sx={{ display: "block", width: "95vw" }}
container
component="form"
onSubmit={handleSubmit(onSubmit)}
>
<FormGroup onSubmit={handleSubmit(onSubmit)}>
<Button
sx={{ width: "100%", marginBottom: "50px" }}
sx={{ width: "100%", marginBottom: "35px" }}
variant="outlined"
onClick={handleAllClear}
>
Expand All @@ -116,7 +121,7 @@ export function ConvertForm() {
<TextField
sx={{ width: "100%" }}
label="DAR(src) Directory"
placeholder="<MOD NAME>/DynamicAnimationReplacer/_CustomCondition/"
placeholder="[...]/<MOD NAME>"
required
value={value}
variant="outlined"
Expand All @@ -128,7 +133,20 @@ export function ConvertForm() {
onBlur={onBlur}
error={Boolean(error)}
helperText={
"Any path under a dir named DynamicAnimationReplacer can be specified."
<>
<p>
[Required] Path of dir containing
&quot;DynamicAnimationReplacer&quot;.{" "}
</p>
<p>
&quot;C:\\[...]/Mod Name/&quot; -&gt; Convert 1st & 3rd
person
</p>
<p>
&quot;[...]/animations/DynamicAnimationReplacer/&quot;
-&gt; Convert only 3rd person
</p>
</>
}
/>
</Grid>
Expand Down Expand Up @@ -163,7 +181,7 @@ export function ConvertForm() {
onBlur={onBlur}
error={Boolean(error)}
helperText={
"A dir named meshes/actors/ will be created in the specified directory."
'[Optional] Creates a OAR path in specified directory.(e.g. "NewMod" -> "NewMod/meshes/[...])'
}
/>
</Grid>
Expand Down Expand Up @@ -200,9 +218,7 @@ export function ConvertForm() {
}}
onBlur={onBlur}
error={Boolean(error)}
helperText={
"Correspondence path that can change the priority number to your own section name instead of the dir name"
}
helperText={<MappingHelpBtn />}
/>
</Grid>

Expand Down Expand Up @@ -239,7 +255,7 @@ export function ConvertForm() {
onBlur={onBlur}
error={Boolean(error)}
helperText={
"Correspondence path that can change the priority number to your own section name instead of the dir name"
"[Optional] File path that helps map priority number to a section name."
}
/>
</Grid>
Expand Down Expand Up @@ -275,7 +291,7 @@ export function ConvertForm() {
}}
onBlur={onBlur}
error={Boolean(error)}
helperText={error?.message}
helperText={"[Optional]"}
/>
)}
/>
Expand All @@ -301,7 +317,7 @@ export function ConvertForm() {
}}
onBlur={onBlur}
error={Boolean(error)}
helperText={error?.message}
helperText={"[Optional]"}
/>
)}
/>
Expand Down Expand Up @@ -349,3 +365,28 @@ export function ConvertForm() {
</Grid>
);
}

function MappingHelpBtn() {
const handleMappingClick = () =>
open(
"https://github.com/SARDONYX-sard/dar-to-oar/wiki#what-is-the-mapping-file"
);

return (
<>
<p>
[Optional] File path that helps map priority number to a section name.
</p>
<p>
See {" "}
<a
style={{ cursor: "pointer", color: "#00c2ff" }}
onClick={handleMappingClick}
>
[What is the mapping file?]
</a>
(Jump to wiki)
</p>
</>
);
}
2 changes: 1 addition & 1 deletion frontend/src/components/log_file_btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const LogFileButton = () => {
sx={{
marginTop: "9px",
width: "100%",
height: "80%",
height: "60%",
}}
variant="outlined"
onClick={async () => openLogFile().catch((e) => toast.error(`${e}`))}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/pages/converter.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";

import { ConvertForm } from "@/components/form";
import { useDynStyleWithStorage, useToastLimit } from "@/hooks";
import { useDynStyle, useToastLimit } from "@/hooks";
import { Box } from "@mui/material";
import { Toaster } from "react-hot-toast";

export default function Converter() {
useToastLimit(1);
useDynStyleWithStorage();
useDynStyle();

return (
<>
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/components/pages/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";

import { Box, TextField } from "@mui/material";
import { useDynStyle } from "@/hooks";
import { useDynStyle, useStorageState } from "@/hooks";
import { SelectStyleList } from "./../style_list";

export default function Settings() {
const [style, setStyle] = useDynStyle();
const [preset, setPreset] = useStorageState("presetNumber", "0");

return (
<Box
Expand All @@ -29,6 +30,8 @@ export default function Settings() {
multiline
onChange={(e) => {
setStyle(e.target.value);
localStorage.setItem("customCSS", e.target.value);
setPreset("0");
}}
placeholder="{ body: url('https://localhost' }"
value={style}
Expand All @@ -43,7 +46,11 @@ export default function Settings() {
maxHeight: "30%",
}}
>
<SelectStyleList setStyle={setStyle} />
<SelectStyleList
preset={preset}
setPreset={setPreset}
setStyle={setStyle}
/>
</Box>
</Box>
);
Expand Down
Loading
Loading