Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
80c27df
Migrate most of the travis.ci job
leipert Nov 7, 2019
b6f760c
Add simple script for running the update check
leipert Nov 7, 2019
23b2cd9
Add artifact logic
leipert Nov 7, 2019
795cba3
Standard node example
leipert Nov 7, 2019
139d103
Use ubuntu latest
leipert Nov 7, 2019
f1d3b5c
Ignore if artifact cannot be downloaded
leipert Nov 7, 2019
0307b13
Add custom workflow
leipert Nov 8, 2019
c62c410
Fix path to private action
leipert Nov 8, 2019
898dd89
Add dependencies
leipert Nov 8, 2019
8f8fdcf
Add missing dependencies
leipert Nov 8, 2019
d7debac
Update private check action
leipert Nov 8, 2019
ed1a7db
Update actions script
leipert Nov 8, 2019
349ebf1
Only run job if necessary
leipert Nov 8, 2019
b1185fe
Update to run full build
leipert Nov 8, 2019
22a003c
Add env variables
leipert Nov 8, 2019
6def9a7
Fix syntax for secret variable
leipert Nov 8, 2019
495cf55
Add new cache push action
leipert Nov 8, 2019
9dbe125
Run container job on different machine
leipert Nov 8, 2019
4d27576
Fix job syntax
leipert Nov 8, 2019
fb8a74e
Better docker file
leipert Nov 8, 2019
0858c09
Correct build path
leipert Nov 8, 2019
971b362
Fix docker file yet again
leipert Nov 8, 2019
5e861e4
Try to pull from cache
leipert Nov 8, 2019
297d446
Correct syntax
leipert Nov 8, 2019
7f1ba01
Use cache
leipert Nov 8, 2019
8b24300
Yay
leipert Nov 8, 2019
9286662
disable schedule
leipert Nov 8, 2019
2020dab
Fix restore build
leipert Nov 8, 2019
7b0f298
Run on schedule and all branches
leipert Nov 8, 2019
51ccc78
Proper caching
leipert Nov 8, 2019
68482ba
Properly define names and everything
leipert Nov 8, 2019
e60af77
Remove old "has update"
leipert Nov 8, 2019
0f8c528
Remove GitLab CI yml
leipert Nov 8, 2019
58deebd
Remove travis yml
leipert Nov 8, 2019
a6c6ad4
Use CWD as base
leipert Nov 8, 2019
f8f1eb8
Log status codes
leipert Nov 8, 2019
68fa5c6
Debug output
leipert Nov 8, 2019
e86d8f9
Wait for cache to hit
leipert Nov 8, 2019
080acf9
Add cache id
leipert Nov 8, 2019
103952d
Run if cache does hit
leipert Nov 8, 2019
52daeba
Debug
leipert Nov 8, 2019
123de6d
A bit of async await
leipert Nov 8, 2019
2873ca9
New cache
leipert Nov 8, 2019
5f627ef
Remove unnecessary conditions
leipert Nov 8, 2019
4dd94c7
Go full async await
leipert Nov 8, 2019
59972ac
Fix trigger logic
leipert Nov 8, 2019
4d2649c
Remove debug steps
leipert Nov 8, 2019
a56499a
Async/Await
leipert Nov 8, 2019
91531bd
Use https library instead of superagent
leipert Nov 8, 2019
5ea1087
Merge remote-tracking branch 'origin/master' into leipert-patch-1
leipert Nov 8, 2019
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
10 changes: 10 additions & 0 deletions .github/check-if-full-run/.yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Source files
*.md
*.map
*.ts
*.min.js

### Reducing code size:
lodash/*
!lodash/lodash.js
!lodash/package.json
10 changes: 10 additions & 0 deletions .github/check-if-full-run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Check if full run'
description: |
The full pipeline runs a long time, with this we are going to check whether
we actually need to run a full pipeline.
outputs:
run_full: # id of output
description: 'Whether to run the full pipeline (boolean)'
runs:
using: 'node12'
main: 'index.js'
139 changes: 139 additions & 0 deletions .github/check-if-full-run/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
const fs = require('fs');
const path = require('path');

const core = require('@actions/core');
const _ = require('lodash');

const { allProducts } = require('./../../lib/shared');
const definitions = require('./../../assets/definitions');

core.setOutput('run_full', 'no');

const TMP_DIR = path.join(process.cwd(), 'tmp');
const PREV_FILE = path.join(TMP_DIR, 'previous.json');

const getPrevious = async () => {
try {
const json = fs.readFileSync(PREV_FILE, 'utf8');

return JSON.parse(json);
} catch (err) {
return err;
}
};

const saveCurrent = async currentData => {
if (!fs.existsSync(TMP_DIR)) {
fs.mkdirSync(TMP_DIR);
}

fs.writeFileSync(PREV_FILE, JSON.stringify(currentData, null, 2));

return currentData;
};

let all = null;

const getAllProducts = async () => {
if (all) {
return all;
}

all = await allProducts();

return all;
};

const getCurrent = async () => {
try {
const jetbrainsCodes = definitions.map(x => x.jetbrainsCode);

const allDefinitions = await getAllProducts();

const currentData = allDefinitions.filter(product => jetbrainsCodes.includes(product.code));

return saveCurrent(currentData);
} catch (err) {
return err;
}
};

const lastReleaseDate = product =>
_.chain(product)
.get('releases', [])
.last()
.get('date', '1970-01-01')
.value();

const searchForUnknownProjects = async () => {
let allDefinitions = await getAllProducts();

const jetbrainsCodes = definitions.map(x => x.jetbrainsCode);

const missingCasks = allDefinitions
.filter(
product =>
!jetbrainsCodes.includes(product.code) &&
_.get(product, 'distributions.mac', false) &&
lastReleaseDate(product) > '2018-12-11'
)
.map(product => {
const lastDownload = _.chain(product)
.get('releases', [])
.last()
.get('downloads.mac.link')
.value();

if (!lastDownload) {
return `${product.name} (${product.code}) has no downloadLink for MAC:
${JSON.stringify(product, null, 2)}`;
}
return `Missing cask (${product.code}): ${product.name} (${product.link})
\t\tLast release: ${lastReleaseDate(product)}, ${lastDownload}`;
});

if (missingCasks.length > 0) {
throw new Error(`
Found unknown casks:
\t${missingCasks.join('\n\t')}
`);
}
};

async function main() {
const [previous, current] = await Promise.all([getPrevious(), getCurrent()]);

let shouldTrigger = true;

if (_.isError(current)) {
core.warning('Could not retrieve current jetbrains data');
core.warning(current.message);
shouldTrigger = false;
}

if (_.isError(previous)) {
core.warning('Could not retrieve previous jetbrains data');
core.warning(previous.message);
}

if (_.isEqual(previous, current)) {
core.warning('JetBrains has released no new versions');
shouldTrigger = false;
}

if (shouldTrigger) {
core.warning('Triggering build');
core.setOutput('run_full', 'yes');
} else {
core.warning('A build was not triggered');
}

await searchForUnknownProjects();

return process.exit(0);
}

main().catch(e => {
console.warn(e);
core.setFailed(e.message);
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading