Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.0.1'
Browse files Browse the repository at this point in the history
CosmoMyzrailGorynych committed Mar 27, 2022
2 parents 306f876 + 96e292f commit 8782b6a
Showing 8 changed files with 2,968 additions and 196 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -40,6 +40,8 @@ desktop\.ini
# Generated files
src/typedefs/ct.js/types.d.ts
app/examples
app/templates
app/bundledAssets
app/data/bundle.js
app/data/riotTags.js
app/data/bundle.css
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -60,7 +60,8 @@ pack-deploy-release:
- npm i -g gulp-cli
- gulp -f devSetup.gulpfile.js
- gulp packages --buildNum=$CI_COMMIT_TAG
- gulp deployOnly --buildNum=$CI_COMMIT_TAG
- gulp deployItchOnly --buildNum=$CI_COMMIT_TAG
- gulp sendGithubDraft --buildNum=$CI_COMMIT_TAG
only:
- tags
- master
@@ -76,5 +77,5 @@ pack-deploy-nightly:
- npm i -g gulp-cli
- gulp -f devSetup.gulpfile.js
- gulp packages --nightly --buildNum=$CI_COMMIT_SHORT_SHA
- gulp deployOnly --nightly --buildNum=$CI_COMMIT_SHORT_SHA
- gulp deployItchOnly --nightly --buildNum=$CI_COMMIT_SHORT_SHA

45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![](https://raw.githubusercontent.com/ct-js/ct-js/develop/branding/GithubHeader.png)

[![](https://img.shields.io/badge/license-MIT-informational?style=flat-square)](https://github.com/ct-js/ct-js/blob/develop/LICENSE) [![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/ct-js/ct-js?label=version&style=flat-square)](https://github.com/ct-js/ct-js/releases) [![Travis (.org) master branch](https://img.shields.io/travis/ct-js/ct-js/master?style=flat-square)](https://travis-ci.org/ct-js/ct-js/branches) [![Gitlab CI develop branch](https://img.shields.io/gitlab/pipeline-status/CoMiGo/ct-js?branch=develop&label=dev%20build&style=flat-square)](https://travis-ci.org/ct-js/ct-js)
[![](https://img.shields.io/badge/license-MIT-informational?style=flat-square)](https://github.com/ct-js/ct-js/blob/develop/LICENSE) [![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/ct-js/ct-js?label=version&style=flat-square)](https://github.com/ct-js/ct-js/releases) [![Gitlab CI master branch](https://img.shields.io/gitlab/pipeline-status/CoMiGo/ct-js?branch=master&label=ct.js%20builds&style=flat-square)](https://gitlab.com/CoMiGo/ct-js/-/commits/master) [![Gitlab CI develop branch](https://img.shields.io/gitlab/pipeline-status/CoMiGo/ct-js?branch=develop&label=nightly%20builds&style=flat-square)](https://gitlab.com/CoMiGo/ct-js/-/commits/develop)

[![](https://img.shields.io/discord/490052958310891520?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/CggbPkb) [![GitHub issues by-label](https://img.shields.io/github/issues/ct-js/ct-js/state:to%20do?style=flat-square&label=todo%20issues)](https://github.com/ct-js/ct-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22state%3Ato+do%22) [![GitHub issues by-label](https://img.shields.io/github/issues/ct-js/ct-js/state:current%20release?style=flat-square&label=current%20release%20issues)](https://github.com/ct-js/ct-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22state%3Acurrent+release%22)
[![GitHub issues by-label](https://img.shields.io/github/issues/ct-js/ct-js/help%20wanted?style=flat-square&label=help%20wanted)](https://github.com/ct-js/ct-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
@@ -80,9 +80,35 @@ Use `gulp dev` instead of just `gulp` to run a dev service with live-reloading w

VSCode can use [this extension](https://marketplace.visualstudio.com/items?itemName=ruakr.vsc-nwjs) to run ct.js with an attached debugger. Before running the debugger, to allow live-reloading, run `gulp dev`.

## Releasing ct.js
## Linting

This is left for emergencies only, as Travis should prepare binaries for github and send them to itch.io as well
Linting checks for code formatting issues, runs ESLint, and also checks i18n files for extra keys.

```sh
gulp lint
```

There are also separate commands for running specific tests only:

```sh
gulp lintJS
gulp lintTags
gulp lintStylus
gulp lintI18n
```

## Getting your changes into production

It's actually easy and robust. We have [regular ct.js](https://comigo.itch.io/ct) for core releases and [ct.js Nightly](https://comigo.itch.io/ct-nightly) as a canary/preview build.

* Once your PR was approved and merged, it gets into the `develop` branch.
* Every change to `develop` triggers a CI build, and a new version of [ct.js Nightly](https://comigo.itch.io/ct-nightly) is released publicly.
* To automatically update ct.js Nightly, we recommend using [the official itch.io app](https://itch.io/app).
* Every now and then maintainers decide to release a public version of ct.js — it involves version bumping, creating and cleaning changelog, updating screenshot, website, presskit data and such. Some stuff is automated, but it still involves manual work and public announcements on different channels. But if your change got into `develop`, it means it will reach the `master` branch as well.

### Releasing ct.js

This is left for emergencies only, as Gitlab CI should prepare binaries for github and send them to itch.io as well

```sh
# Builds docs and adds them to ct.js app
@@ -92,10 +118,15 @@ gulp packages

# Publishes prebuilt binaries to itch.io
# This assumes that you have an access to ct.js at itch.io :)
gulp deployOnly
gulp deployOnly --channel next # deploy to a specific itch.io channel
gulp deployItchOnly
gulp deployItchOnly --channel next # deploy to a specific itch.io channel

# Creates a draft release on GitHub
# Needs a GITHUB_TOKEN in your environment variables.
# Does nothing on nightly releases
gulp sendGithubDraft

# Combines `gulp packages` and `gulp deployOnly`
# Combines `gulp packages`, `gulp sendGithubDraft`, and `gulp deployItchOnly`
gulp deploy
```

@@ -108,3 +139,5 @@ Use [Gitmoji-flavored Comigoji](https://comigo.gitlab.io/comigoji/#gitmoji) for
Use [Comigo's CSS naming guide](https://cosmomyzrailgorynych.github.io/css-naming-guide/) for styling

We have some references for ct.js' internals on [our wiki](https://github.com/ct-js/ct-js/wiki).

The ct.js app has a built-in CSS stylebook in the Meta section of the main menu.
12 changes: 12 additions & 0 deletions app/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v2.0.1

*Sat Mar 26 2022*

### ⚡️ General Improvements

* Internal: automate publishing to Github assets with Gulp and Gitlab CI

### 🐛 Bug Fixes

* Fix the missing asset gallery's assets

## v2.0.0

*Sat Mar 26 2022*
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"main": "index.html",
"name": "ctjs",
"description": "ct.js — a free 2D game engine",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "https://ctjs.rocks/",
"author": {
"name": "Cosmo Myzrail Gorynych",
34 changes: 30 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -592,6 +592,9 @@ const examples = () => gulp.src('./src/examples/**/*')
const templates = () => gulp.src('./src/projectTemplates/**/*')
.pipe(gulp.dest('./app/templates'));

const gallery = () => gulp.src('./bundledAssets/**/*')
.pipe(gulp.dest('./app/bundledAssets'));

// eslint-disable-next-line valid-jsdoc
/**
* @see https://stackoverflow.com/a/22907134
@@ -622,15 +625,16 @@ const packages = gulp.series([
docs,
patronsCache,
examples,
templates
templates,
gallery
]),
bakePackages,
// fixSymlinks,
// fixPermissions,
zipPackages
]);

const deployOnly = () => {
const deployItchOnly = () => {
console.log(`For channel ${channelPostfix}`);
if (nightly) {
return spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/linux32`, `comigo/ct-nightly:linux32${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', buildNumber])
@@ -645,8 +649,29 @@ const deployOnly = () => {
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/win32`, `comigo/ct:win32${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', pack.version]))
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/win64`, `comigo/ct:win64${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', pack.version]));
};
const sendGithubDraft = async () => {
if (nightly) {
return; // Do not create github releases for nightlies
}
const readySteady = (await import('readysteady')).default;
const draftData = await readySteady({
owner: 'ct-js',
repo: 'ct-js',
// eslint-disable-next-line id-blacklist
tag: `v${pack.version}`,
force: true,
files: [
`./build/ctjs - v${pack.version}/ct.js v${pack.version} for linux32.zip`,
`./build/ctjs - v${pack.version}/ct.js v${pack.version} for linux64.zip`,
`./build/ctjs - v${pack.version}/ct.js v${pack.version} for osx64.zip`,
`./build/ctjs - v${pack.version}/ct.js v${pack.version} for win32.zip`,
`./build/ctjs - v${pack.version}/ct.js v${pack.version} for win64.zip`
]
});
console.log(draftData);
};

const deploy = gulp.series([packages, deployOnly]);
const deploy = gulp.series([packages, gulp.parallel([sendGithubDraft, deployItchOnly])]);

const launchDevMode = done => {
watch();
@@ -670,7 +695,8 @@ exports.patronsCache = patronsCache;
exports.docs = docs;
exports.build = build;
exports.deploy = deploy;
exports.deployOnly = deployOnly;
exports.deployItchOnly = deployItchOnly;
exports.sendGithubDraft = sendGithubDraft;
exports.default = defaultTask;
exports.dev = devNoNW;
exports.bakeCompletions = bakeCompletions;
3,061 changes: 2,879 additions & 182 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ctjsbuildenvironment",
"version": "2.0.0",
"version": "2.0.1",
"description": "",
"directories": {
"doc": "docs"
@@ -50,6 +50,7 @@
"nw-builder": "^3.5.7",
"pug": "^3.0.2",
"pug-lint-config-clock": "^2.0.0",
"readysteady": "^1.1.4",
"riot": "^3.13.2",
"streamqueue": "^1.1.2",
"stylint-stylish": "^2.0.0",

0 comments on commit 8782b6a

Please sign in to comment.