Skip to content

Commit

Permalink
[gh actions] fix macos (OSX) (#36)
Browse files Browse the repository at this point in the history
[gh actions] fix macos
  • Loading branch information
nerdCopter authored Dec 20, 2023
1 parent 43750f9 commit faef1da
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 83 deletions.
54 changes: 44 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
#https://github.com/actions/runner-images
os: [ubuntu-22.04, macos-11, windows-2022]
outputs:
buildtag: ${{ steps.ids.outputs.buildtag }}
shortsha: ${{ steps.ids.outputs.shortsha }}
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
continue-on-error: false

- name: get tag & short-sha
Expand All @@ -46,9 +47,9 @@ jobs:
continue-on-error: true

- name: setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16.16.0'
node-version: '16'
continue-on-error: false

# for debugging
Expand All @@ -65,12 +66,21 @@ jobs:
echo "ShortSha: ${{ steps.ids.outputs.shortsha }}"
continue-on-error: true

- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.11'
#required for appdmg failing

# build stuff
- name: yarn install
run: yarn install
run: |
npm config set fetch-retry-maxtimeout 600000 -g
yarn install --immutable --immutable-cache --check-cach
- name: yarn gulp clean-release
run: yarn gulp clean-release
continue-on-error: true

- name: yarn gulp release --linux64
if: ${{ startsWith(matrix.os, 'ubuntu') }}
Expand All @@ -79,6 +89,13 @@ jobs:
yarn gulp release --linux64
continue-on-error: false

# this forces appdmg install even though package.json optionalDependencies has/needs it.
- name: setup macos
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
npm install [email protected] --python=python2.7
continue-on-error: false

- name: yarn gulp release --osx64
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
Expand All @@ -91,11 +108,28 @@ jobs:
continue-on-error: false

- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: ${{ startsWith(matrix.os, 'ubuntu') }}
uses: actions/upload-artifact@v4
with:
name: EmuFlight-Blackbox-Explorer-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}
path: release/*

name: EmuFlight-Blackbox-Explorer-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}-Linux
path: |
release/*.rpm
release/*.deb
release/*.zip
- name: Upload Artifacts
if: ${{ startsWith(matrix.os, 'macos') }}
uses: actions/upload-artifact@v4
with:
name: EmuFlight-Blackbox-Explorer-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}-OSX
path: release/*.dmg
- name: Upload Artifacts
if: ${{ startsWith(matrix.os, 'windows') }}
uses: actions/upload-artifact@v4
with:
name: EmuFlight-Blackbox-Explorer-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}-Windows
path: |
release/*win*.exe
release/*win*.zip
releases:
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -120,7 +154,7 @@ jobs:
continue-on-error: true

- name: download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: EmuFlight-Blackbox-Explorer-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}
continue-on-error: false
Expand Down
31 changes: 0 additions & 31 deletions gulp-appdmg.js

This file was deleted.

30 changes: 30 additions & 0 deletions gulp-macdmg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var appdmg = require('appdmg');
var through = require('through2');
var PluginError = require('plugin-error');
var log = require('fancy-log');

var PLUGIN_NAME = 'gulp-macdmg';

module.exports = function(options) {
var stream = through.obj(function(file, encoding, next) {
next();
}, function(callback) {
var self = this;
var ee = appdmg(options);

ee.on('progress', function(info) {
log(info.current + '/' + info.total + ' ' + info.type + ' ' + (info.title || info.status));
});

ee.on('error', function(err) {
self.emit('error', new PluginError(PLUGIN_NAME, err));
callback();
});

ee.on('finish', callback);
});

// returning the file stream
stream.resume();
return stream;
};
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const pkg = require('./package.json');
// remove gulp-appdmg from the package.json we're going to write
delete pkg.optionalDependencies['gulp-appdmg'];

const fs = require('fs');
const path = require('path');
Expand Down Expand Up @@ -515,7 +517,7 @@ function release_rpm(arch, appDirectory, done) {

// Create distribution package for macOS platform
function release_osx64(appDirectory) {
var appdmg = require('./gulp-appdmg');
const appdmg = require('./gulp-macdmg');

// The appdmg does not generate the folder correctly, manually
createDirIfNotExists(RELEASE_DIR);
Expand Down
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,13 @@
"through2": "4.0.2",
"yarn": "^1.22.0"
},
"optionalDependencies": {
"appdmg": "^0.6.2"
},
"resolutions": {
"**/**/lodash.template": "^4.5.0"
},
"engines": {
"node": "16.x"
},
"config": {
"platformDependentModules": {
"darwin": [
"appdmg@^0.6.2"
]
}
"optionalDependencies": {
"appdmg": "^0.6.6"
}
}
Loading

0 comments on commit faef1da

Please sign in to comment.