Skip to content

Commit

Permalink
updating workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Jan 22, 2025
1 parent 94b57be commit 2853a4e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,34 @@ env:
DOTNET_NOLOGO: 1

jobs:
electron-versions:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.electron-versions.outputs.matrix }}

name: electron-versions
steps:
- name: Electron versions
shell: bash
id: electron-versions
run: |
node tools/getVersions.js
echo "matrix=$(cat electron-versions.txt)" >> $GITHUB_OUTPUT
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14, ubuntu-22.04, ubuntu-22.04-arm, windows-2022]
# os: [ macos-14, ubuntu-22.04]
# electron: [32.1.2]
electron: [29.4.6, 30.5.1, 31.7.7, 32.2.8, 33.3.1, 34.0.0]
matrix: ${{ fromJSON(needs.electron-versions.outputs.matrix) }}
runs-on: ${{ matrix.os }}
needs: electron-versions

# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [macos-13, macos-14, ubuntu-22.04, ubuntu-22.04-arm, windows-2022]
# # os: [ macos-14, ubuntu-22.04]
# # electron: [32.1.2]
# electron: [29.4.6, 30.5.1, 31.7.7, 32.2.8, 33.3.2, 34.0.1]

name: test-${{ matrix.os }}-v${{ matrix.electron }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ mochawesome.json

release
*.zip
electron*.txt

3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ mochawesome.json
xunit*.*
getVersion*.js
*.vcxproj
getVersion*.js
getVersion*.js
electron*.txt
14 changes: 8 additions & 6 deletions tools/getVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ const http = require('isomorphic-git/http/web');
const git = require("isomorphic-git");
const { get } = require("https");

const majors = [29, 30, 31, 32, 33];
const majors = [29, 30, 31, 32, 33, 34];

git.getRemoteInfo({
http,
//corsProxy: "https://cors.isomorphic-git.org",
url: "https://github.com/electron/electron"
}).then(info =>{
let result = Object.keys(info.refs.tags);
let oses = ['macos-13', 'macos-14', 'ubuntu-22.04', 'ubuntu-22.04-arm', 'windows-2022'];
let versions = [];
majors.forEach((major) => {
versions.push(getVersion(result, major));

oses.forEach((os) => {
versions.push({'electron': getVersion(result, major), 'os': `${os}`});
});
});
let res = `{'include':${JSON.stringify(versions)}}`
fs.writeFileSync('electron.txt', res);
fs.writeFileSync('electron-versions.txt', res);
console.log(res);
});

Expand All @@ -29,9 +33,7 @@ function getVersion(result, major){
.reverse();

if(result.length !== 0){
return {'electron':`${result[0].replace('v', '')}`}
//fs.writeFileSync('electron.txt', version);
//console.log(version);
return result[0].replace('v', '')
}
else{
throw `Unable to resolve latest version for Electron ${major}`
Expand Down

0 comments on commit 2853a4e

Please sign in to comment.