Skip to content

Commit

Permalink
(Probably) Add auto packaging script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx committed May 14, 2022
1 parent 0550ec2 commit f3fe29c
Show file tree
Hide file tree
Showing 5 changed files with 2,503 additions and 89 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: NodeJS with Webpack

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build
run: |
npm install
grunt package
- name: GH Release
uses: softprops/action-gh-release@v0.1.7
with:
files: |
packaged/norna.mcpack
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
scripts/**
scripts/**
norna.mcpack
packaged
34 changes: 34 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const webpackConfig = require('./webpack.config.js');

module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
webpack: {
build: webpackConfig,
watch: Object.assign({ watch: true }, webpackConfig),
},
compress: {
main: {
options: {
mode: "zip",
archive: './packaged/norna.mcpack'
},
files: [{
src: ["scripts", "scripts/**", "manifest.json", "pack_icon.png"]
}]
}
}
});

grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-contrib-compress')

grunt.registerTask('build', ['webpack:build'])
grunt.registerTask('install', ' Build and install the addon to the game\'s addon directory.', function () {
grunt.task.run('webpack:build')
})
grunt.registerTask('package', '', function () {
grunt.task.run('webpack:build')
grunt.task.run('compress:main')
})
};
Loading

0 comments on commit f3fe29c

Please sign in to comment.