Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
webpack.config.js
html/*.js
scripts/*.js
node_modules
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false # continue other tests if one os fails
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,22 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: latest
commitish: master
name: Development Build
body: Contains the vsix-file from the latest push to master.
prerelease: true
files: "artifacts/*/*"
gzip: false
allow_override: true

publish:
name: Publish Devbuild
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: node scripts/prepareDevbuild.js
- run: npm install
- uses: lannonbr/vsce-action@master
with:
args: "publish -p $VSCE_TOKEN_DEV_BUILD"
env:
VSCE_TOKEN_DEV_BUILD: ${{ secrets.VSCE_TOKEN_DEV_BUILD }}
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ html/*.ts
node_modules
out/
out/test/**
scripts/**
src/
src/**
test/**
Expand Down
5 changes: 5 additions & 0 deletions README-dev-build-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Dev Build

This is a development build!


1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"license": "SEE LICENSE IN LICENSE",
"publisher": "Ikuyadeu",
"icon": "images/Rlogo.png",
"preview": false,
"repository": {
"type": "git",
"url": "https://github.com/Ikuyadeu/vscode-R"
Expand Down
24 changes: 24 additions & 0 deletions scripts/prepareDevbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use strict";
exports.__esModule = true;
var fs = require("fs");
// file names
var README = './README.md';
var README_NOTE = './README-dev-build-note.md';
var PACKAGE = './package.json';
// parse package.json
var json = JSON.parse(fs.readFileSync(PACKAGE, 'utf-8'));
// construct version from year.month.monthMinutes
var date = new Date();
var monthMinutes = (date.getDate() - 1) * 24 * 60 + date.getHours() * 60 + date.getMinutes();
var version = date.getFullYear() + "." + (date.getMonth() + 1) + "." + monthMinutes;
// modify json and write back to package.json
json.version = version;
json.name = 'r-dev';
json.displayName = 'R - Development Build';
json.preview = true;
fs.writeFileSync(PACKAGE, JSON.stringify(json, undefined, 4));
// add note to readme
var readme = fs.readFileSync(README, 'utf-8');
var readmeNote = fs.readFileSync(README_NOTE, 'utf-8');
var newReadme = readmeNote + "\n" + readme;
fs.writeFileSync(README, newReadme);
41 changes: 41 additions & 0 deletions scripts/prepareDevbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

import * as fs from 'fs';

// items of package.json that are modified
interface packageInfo {
version?: string,
name?: string,
displayName?: string,
preview?: boolean
}

// file names
const README = './README.md';
const README_NOTE = './README-dev-build-note.md';
const PACKAGE = './package.json';

// parse package.json
const json = <packageInfo>JSON.parse(fs.readFileSync(PACKAGE, 'utf-8'));

// construct version from year.month.monthMinutes
const date = new Date();
const monthMinutes = (date.getDate() - 1) * 24 * 60 + date.getHours() * 60 + date.getMinutes();
const version = `${date.getFullYear()}.${date.getMonth() + 1}.${monthMinutes}`;

// modify json and write back to package.json
json.version = version;
json.name = 'r-dev';
json.displayName = 'R - Development Build';
json.preview = true;

fs.writeFileSync(PACKAGE, JSON.stringify(json, undefined, 4));


// add note to readme
const readme = fs.readFileSync(README, 'utf-8');
const readmeNote = fs.readFileSync(README_NOTE, 'utf-8');
const newReadme = `${readmeNote}\n${readme}`;

fs.writeFileSync(README, newReadme);


3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"exclude": [
"node_modules",
".vscode-test",
"html/*"
"html",
"scripts"
]
}