Merge branch 'master' into old-system
This commit is contained in:
commit
21d17ba037
12
gulpfile.js
12
gulpfile.js
@ -4,7 +4,7 @@ const sourcemaps = require('gulp-sourcemaps');
|
|||||||
const sass = require('gulp-sass')(require('sass'));
|
const sass = require('gulp-sass')(require('sass'));
|
||||||
const zip = require('gulp-zip');
|
const zip = require('gulp-zip');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const fetch = import('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
const replace = require('gulp-replace');
|
const replace = require('gulp-replace');
|
||||||
const FormData = require('form-data');
|
const FormData = require('form-data');
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ async function uploadToPackageRegistry(done) {
|
|||||||
/* Publish to FoundryVTT
|
/* Publish to FoundryVTT
|
||||||
/* ----------------------------------------- */
|
/* ----------------------------------------- */
|
||||||
|
|
||||||
function publishToFoundry(done) {
|
async function publishToFoundry(done) {
|
||||||
const moduleManifestPath = 'system.json';
|
const moduleManifestPath = 'system.json';
|
||||||
const moduleManifest = JSON.parse(fs.readFileSync(moduleManifestPath));
|
const moduleManifest = JSON.parse(fs.readFileSync(moduleManifestPath));
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ function publishToFoundry(done) {
|
|||||||
|
|
||||||
// Construct the payload
|
// Construct the payload
|
||||||
const payload = {
|
const payload = {
|
||||||
id: id,
|
id: "kidsonbrooms",
|
||||||
release: {
|
release: {
|
||||||
version: version,
|
version: version,
|
||||||
manifest: manifest,
|
manifest: manifest,
|
||||||
@ -299,7 +299,7 @@ function publishToFoundry(done) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send the POST request to Foundry VTT API
|
// Send the POST request to Foundry VTT API
|
||||||
const response = fetch('https://api.foundryvtt.com/_api/packages/release', {
|
const response = await fetch('https://api.foundryvtt.com/_api/packages/release_version', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -308,9 +308,9 @@ function publishToFoundry(done) {
|
|||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
});
|
});
|
||||||
|
|
||||||
const responseData = response.json();
|
const responseData = await response.text();
|
||||||
|
|
||||||
if (responseData.status === 'success') {
|
if (responseData.includes('success')) {
|
||||||
console.log('Successfully published to Foundry VTT:');
|
console.log('Successfully published to Foundry VTT:');
|
||||||
console.log(JSON.stringify(responseData, null, 2));
|
console.log(JSON.stringify(responseData, null, 2));
|
||||||
done();
|
done();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "kidsonbrooms",
|
"name": "kidsonbrooms",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "CSS compiler for the Kids On Brooms system",
|
"description": "CSS compiler for the Kids On Brooms system",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"gulp-sourcemaps": "^2.6.5",
|
"gulp-sourcemaps": "^2.6.5",
|
||||||
"gulp-zip": "^5.0.1",
|
"gulp-zip": "^5.0.1",
|
||||||
"kidsonbrooms": "file:",
|
"kidsonbrooms": "file:",
|
||||||
"node-fetch": "^3.3.2"
|
"node-fetch": "^2.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"sass": "^1.79.1"
|
"sass": "^1.79.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user