Skip to content

Temporary fix for incorrectly updated files on version update #1258

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

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 4 additions & 14 deletions .github/workflows/update-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

jobs:
build:
name: Update p5.js documentation
name: Update p5.js documentation and library files
runs-on: ubuntu-latest

steps:
Expand All @@ -20,28 +20,18 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Extract documentation from the p5.js repo
- name: Extract documentation and library files from the p5.js repo
run: |
npm install
npm run grunt update-enJSON
npm run grunt update-enJSON --target="${{ steps.p5js.outputs.VERSION }}"
- name: Get p5.js release info
id: p5js
run: |
echo ::set-output name=VERSION::${P5JS_REF/refs\/tags\//}
echo ::set-output name=SHA::${P5JS_SHA}
- name: Get latest p5.min.js build
uses: suisei-cn/actions-download-file@v1
with:
url: https://github.com/processing/p5.js/releases/download/${{github.event.client_payload.ref}}/p5.min.js
target: src/assets/js/
- name: Get latest p5.sound.min.js build
uses: suisei-cn/actions-download-file@v1
with:
url: https://github.com/processing/p5.js/releases/download/${{github.event.client_payload.ref}}/p5.sound.min.js
target: src/assets/js/
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
message: 'Update Reference files for p5.js ${{ steps.p5js.outputs.VERSION }} release (${{ steps.p5js.outputs.SHA }})'
message: 'Update files for p5.js ${{ steps.p5js.outputs.VERSION }} release (${{ steps.p5js.outputs.SHA }})'
env:
GITHUB_TOKEN: ${{ secrets.DOCS_COMMIT_TOKEN }}
19 changes: 13 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ module.exports = function(grunt) {
},
shell: {
generate_dataJSON: {
command: 'npm ci && npm run grunt yui',
command: `git checkout ${grunt.option('target')} && npm ci && npm run grunt yui build`,
options: {
execOptions: {
cwd: 'tmp/p5.js'
Expand All @@ -378,7 +378,7 @@ module.exports = function(grunt) {
grunt.registerTask('update-version', function() {
const done = this.async();

const version = require('./src/templates/pages/reference/data.json').project.version;
const version = grunt.option('target').substring(1);

fs.readFile('./src/data/data.yml')
.then(str => {
Expand Down Expand Up @@ -436,6 +436,14 @@ module.exports = function(grunt) {
// move the data.json files from the cloned p5.js repository to the p5.js-website repository
fse.moveSync(dataJSON_p5js, dataJSON_p5jswebsite, { overwrite: true });
fse.moveSync(dataJSONmin_p5js, dataJSONmin_p5jswebsite, { overwrite: true });

const p5min_src = 'tmp/p5.js/lib/p5.min.js';
const p5min_dest = 'src/assets/js/p5.min.js';
const p5Soundmin_src = 'tmp/p5.js/lib/addons/p5.sound.min.js';
const p5Soundmin_dest = 'src/assets/js/p5.sound.min.js';
fse.moveSync(p5min_src, p5min_dest, { overwrite: true });
fse.moveSync(p5Soundmin_src, p5Soundmin_dest, { overwrite: true });

// delete the tmp folder that contained the p5.js repository
fse.removeSync('tmp/');
});
Expand All @@ -451,8 +459,8 @@ module.exports = function(grunt) {
'clone_p5js_repo',
'generate_dataJSON',
'move_dataJSON',
'generate_enJSON',
// 'json-to-fluent'
'update-version',
'generate_enJSON'
]);

// multi-tasks: collections of other tasks
Expand All @@ -476,12 +484,11 @@ module.exports = function(grunt) {

// runs tasks in order
grunt.registerTask('build', [
'update-version',
// 'update-version',
'exec',
'clean',
'requirejs:yuidoc_theme',
'requirejs',
// 'fluent-to-json',
'copy',
'optimize',
'assemble',
Expand Down