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

feat(ci): Move to semantic-release, fix validator issues, bug fixes #31

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
41 changes: 34 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,56 @@ on:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main

jobs:
build:
runs-on: windows-latest

permissions: read-all

strategy:
matrix:
node-version: [16.x]
node-version: [20]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Build
env:
CI: ""
- name: Prep and Command Line Build
run: |
npm ci
pushd app
npm ci
npm run devenvandjsnbuild --max_old_space_size=16384
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devenvandjsnbuild is a mouth full :D

popd

- name: Run Tests
id: runtests
run: |
pushd samplecontent
pushd addon
npm ci
npx gulp package
popd
popd
pushd app
npm test
popd

- name: Web Build
run: |
pushd app
npm run all
npm run webbuild --max_old_space_size=16384
pushd toolbuild
pushd jsn
npm pack --max_old_space_size=16384
popd
popd
popd
70 changes: 42 additions & 28 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,64 @@ jobs:
build-and-publish:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
permissions:
actions: read
pages: write
contents: write
deployments: none
packages: none
pull-requests: write
security-events: none
checks: none
id-token: none
issues: write
repository-projects: none
statuses: none

strategy:
matrix:
node-version: [20]

- name: Get Package Version
id: get-package-version
steps:
- uses: actions/checkout@v4
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
path: app
uses: stevenbenitez/get-package-version-action@v1
node-version: ${{ matrix.node-version }}

- name: Build
- name: Prep and Command Line Build
env:
CI: ""
run: |
npm ci
pushd app
npm run all
npm ci
npm run devenvandjsnbuild --max_old_space_size=16384
pushd toolbuild
pushd jsn
npm pack --max_old_space_size=16384
npm pack --max_old_space_size=16384
popd
popd
gulp customizesite
popd

- name: Create draft Minecraft Creator Tools release
- name: Run Tests
id: runtests
run: |
pushd samplecontent
pushd addon
npm ci
npx gulp package
popd
popd
pushd app
npm test
popd

- name: Create Minecraft Creator Tools release
id: create_mctools_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get-package-version.outputs.version }}-alpha
release_name: Minecraft Creator Tools
draft: true
prerelease: true

- name: Upload mctools-v.tgz to node_module release
id: upload_mctools-v_tgz
uses: actions/[email protected]
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_mctools_release.outputs.upload_url }}
asset_path: ./app/toolbuild/jsn/mctools-${{ steps.get-package-version.outputs.version }}.tgz
asset_name: mctools-${{ steps.get-package-version.outputs.version }}.tgz
asset_content_type: application/tar+gzip

- name: Deploy to GitHub Pages
if: success()
Expand Down
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.80]

### Updated
Expand Down Expand Up @@ -64,3 +60,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added

- Initial version work

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

2 changes: 0 additions & 2 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

### tui-grid

### tui-image-editor

#### MIT License

Copyright (c) 2019 NHN Cloud Corp.
Expand Down
25 changes: 24 additions & 1 deletion app/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const importTransform = require("./tools/gulp-importTransform");
const nodeifyScript = require("./tools/gulp-nodeifyScript");
const jsonifyTypes = require("./tools/gulp-jsonifyTypes");
const downloadResources = require("./tools/gulp-downloadResources");
const updateVersions = require("./tools/gulp-updateVersions");
const textReplaceStream = require("./tools/gulp-textReplaceStream");
const gulpWebpack = require("webpack-stream");

Expand All @@ -18,6 +19,8 @@ const jsnbuildfilesigs = [
"!build/**/*",
"!toolbuild/**/*",
"!scriptlibs/**/*",
"!test/results/**/*",
"!test/scenarios/**/*",
"!dist/**/*",
"!res/**/*",
"!src/monaco/*.ts",
Expand All @@ -37,6 +40,8 @@ const jsnwebbuildfilesigs = [
"!build/**/*",
"!toolbuild/**/*",
"!scriptlibs/**/*",
"!test/results/**/*",
"!test/scenarios/**/*",
"!dist/**/*",
"!res/**/*",
"!src/setupTests.ts",
Expand All @@ -63,6 +68,8 @@ const mclibsigs = [
"scriptlibs/@minecraft/vanilla-data/minecraft-vanilla-data.ts",
];

const versionSource = ["toolbuild/jsn/package.json"];

const mcreslistsigs = ["reslist/schemas.resources.json"];
const mcreslistvanillasigs = ["reslist/packs.resources.json"];
const mcreslistsamplesigs = ["reslist/samples.resources.json"];
Expand Down Expand Up @@ -137,7 +144,7 @@ function copyEsbuildWasmDist() {
}

function copyJsNodeDocs() {
return gulp.src(["../CHANGELOG.md", "../NOTICE.md", "jsnode/README.md"]).pipe(gulp.dest("toolbuild/jsn/"));
return gulp.src(["../CHANGELOG.md", "../NOTICE.md"]).pipe(gulp.dest("toolbuild/jsn/"));
}

function copyJsNodeResSchemas() {
Expand Down Expand Up @@ -237,6 +244,20 @@ function runDownloadResources() {
return gulp.src(mcreslistsigs, { base: "" }).pipe(downloadResources("public/res/latest/"));
}

function runUpdateVersions() {
return gulp
.src(versionSource, { base: "" })
.pipe(
updateVersions([
"./package.json",
"./package-lock.json",
"./jsnode/package.json",
"./src/core/Constants.ts",
])
);
}


function runDownloadSamples() {
return gulp.src(mcreslistsamplesigs, { base: "" }).pipe(downloadResources("public/res/samples/microsoft/"));
}
Expand Down Expand Up @@ -271,6 +292,8 @@ gulp.task("mcbuild", gulp.series(gulp.parallel("clean-mcbuild", "webbuild"), bui

gulp.task("mctypes", gulp.parallel(buildBetaJsonTypeDefs, buildStableJsonTypeDefs, buildIncludes));

gulp.task("updateversions", gulp.series(runUpdateVersions));

gulp.task(
"dlres",
gulp.series(
Expand Down
2 changes: 1 addition & 1 deletion app/jsnode/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
16 changes: 8 additions & 8 deletions app/jsnode/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "mctools",
"name": "@minecraft/creator-tools",
"version": "0.2.9",
"productName": "Minecraft Creator Tools",
"description": "Minecraft Creator Tools",
"description": "Minecraft Creator Tools command line and libraries.",
"private": true,
"bin": {
"mct": "./cli/index.js"
},
"dependencies": {
"@octokit/rest": "^18.5.2",
"@rauschma/stringio": "^1.4.0",
"ajv": "^8.11.0",
"axios": "^1.6.4",
"commander": "^8.2.0",
"esbuild-wasm": "^0.21.3",
"eslint": "^8.34.0",
"esprima-next": "^6.0.2",
"exifr": "^7.1.3",
"inquirer": "^8.2.0",
"js-md5": "^0.7.3",
"jszip": "^3.7.1",
"localforage": "^1.9.0",
"open": "^8.3.0",
"pako": "^2.0.4",
"esbuild-wasm": "^0.21.3",
"threads": "^1.7.0",
"eslint": "^8.34.0",
"js-md5": "^0.7.3",
"ajv": "^8.11.0",
"localforage": "^1.9.0",
"permessage-deflate": "^0.1.7",
"ste-events": "^2.0.9",
"threads": "^1.7.0",
"trash": "^8.0.0"
}
}
Loading