Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Aug 5, 2023
1 parent 4e1f3f0 commit f1869d9
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 43 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: ci

on:
push:
tags:
- 'v*'
branches:
- main # Set a branch name to trigger deployment
pull_request:

jobs:
meta:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set_tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
- id: set_tag
run: |
echo tag=$(git describe --tags --match "v*" ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT
build:
needs: meta
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Build webpage
run: |
npm ci
npm run build
- name: Build server
run: |
cd server
npm ci
npm run build
cd ..
- name: Build Package
run: |
cd server
npx pkg . -t node18-x64-windows
mkdir -p out/web
cp -r web/* out/web/
mkdir -p out/saves
cd ..
- uses: actions/upload-artifact@v3
with:
name: MaaJsonViewer-win
path: 'server/out'

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [meta, build]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
path: assets

- run: |
cd assets
for f in *; do
(cd $f && zip -r ../$f-${{ needs.meta.outputs.tag }}.zip .)
done
- uses: softprops/action-gh-release@v1
with:
files: assets/*.zip
tag_name: ${{ needs.meta.outputs.tag }}
36 changes: 0 additions & 36 deletions .github/workflows/deploy.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build-only": "vite build",
"build-watch": "vite build --watch",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"backend": "cd server && npm run run"
"backend": "cd server && npm run run",
"build-all": "npm run build && cd server && npm run build"
},
"dependencies": {
"vue": "^3.3.4"
Expand Down
5 changes: 0 additions & 5 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
},
"bin": "dist/index.js",
"pkg": {
"targets": [
"node18-win-x64",
"node18-linux-x64",
"node18-macos-x64"
],
"outputPath": "out"
}
}
1 change: 0 additions & 1 deletion src/components/SingleNavigateEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
SwipeRightOutlined,
TranslateOutlined
} from '@vicons/material'
import { taskData } from '@/data'
import ImageHover from './ImageHover.vue'
import type { UseProducer } from '@/persis'
import { getTask, taskIndex } from '@/data/task'
Expand Down

0 comments on commit f1869d9

Please sign in to comment.