Skip to content

Commit

Permalink
fixed ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AlPha5130 committed Feb 8, 2023
1 parent 0426a65 commit 8687476
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 26 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2

- uses: actions/setup-node@v3
with:
node_version: 18
cache: pnpm

- name: Install dependencies
run: |
pnpm install
- name: Test build
run: |
node preset_build.js
pnpm run test-build
- name: Upload files built
uses: actions/upload-artifact@v2
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"private": true,
"scripts": {
"format": "prettier --write ./**/*.{js,json}"
"format": "prettier --write ./**/*.{js,json}",
"test-build": "node preset_build.js"
},
"dependencies": {
"glob": "^8.1.0",
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions preset_build.js
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
const { JavaPackBuilder, ModuleParser, Logger } = require('memepack-builder')
const { JavaPackBuilder, ModuleParser } = require('memepack-builder')
const { writeFileSync, existsSync, mkdirSync } = require('fs')
const { resolve } = require('path')
const glob = require('glob')
const PACK_VERSION = '1.7.0'
const PACK_VERSION = '1.8.1'

const preset_args = [
{
platform: 'java',
type: 'normal',
modules: {
resource: [],
resource: ['meme_resource_pack'],
collection: ['choice_modules_1'],
},
mod: [],
format: 7,
format: 9,
compatible: false,
},
{
platform: 'java',
type: 'normal',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: ['choice_modules_1'],
},
mod: ['all'],
format: 7,
format: 9,
compatible: false,
},
{
platform: 'java',
type: 'normal',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: [],
},
mod: [],
format: 7,
format: 9,
compatible: false,
},
{
platform: 'java',
type: 'normal',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: [],
},
mod: [],
format: 7,
format: 9,
compatible: false,
},
{
platform: 'java',
type: 'normal',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: ['choice_modules_1'],
},
mod: ['all'],
format: 7,
format: 9,
compatible: true,
},
{
platform: 'java',
type: 'normal',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: ['choice_modules_1'],
},
mod: [],
format: 7,
format: 9,
compatible: true,
},
{
platform: 'java',
type: 'normal',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: [],
},
mod: [],
format: 7,
format: 9,
compatible: true,
},
{
platform: 'java',
type: 'legacy',
modules: {
resource: ['lang_sfw'],
resource: ['meme_resource_pack', 'lang_sfw'],
collection: ['version_1.12.2-1.15.2'],
},
mod: [],
Expand All @@ -106,9 +106,10 @@ const preset_name = [
]

async function start() {
const jeModules = new ModuleParser(resolve(__dirname, './modules'))
const jeModules = new ModuleParser()
jeModules.addSearchPaths(resolve(__dirname, './modules'))
const je = new JavaPackBuilder(
await jeModules.moduleInfo(),
await jeModules.searchModules(),
resolve(__dirname, './meme_resourcepack'),
{
modFiles: glob.sync('./mods/*.json'),
Expand All @@ -123,10 +124,9 @@ async function start() {
try {
let r = await je.build(arg)
console.log(arg, preset_name[i])
writeFileSync(resolve(__dirname, `./builds/${preset_name[i]}`), r.content)
writeFileSync(resolve(__dirname, `./builds/${preset_name[i]}`), r)
} catch (e) {
console.error(Logger.log, e)
Logger.clearLog()
console.error(e)
process.exit(1)
}
}
Expand Down

0 comments on commit 8687476

Please sign in to comment.