diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c151afef2..b8ec460a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: max-parallel: 3 matrix: #https://github.com/actions/runner-images - os: [ubuntu-22.04, macos-11, windows-2022] + os: [ubuntu-22.04, macos-12, windows-2022] outputs: buildtag: ${{ steps.ids.outputs.buildtag }} shortsha: ${{ steps.ids.outputs.shortsha }} @@ -84,7 +84,9 @@ jobs: - name: setup macos if: ${{ startsWith(matrix.os, 'macos') }} run: | - npm install appdmg@0.6.6 --python=python2.7 + sudo -H pip install setuptools packaging + sudo npm install -g yarn@1.22.0 node-gyp@5.1.1 macos-alias + yarn --network-timeout 1000000 continue-on-error: true - name: yarn gulp clean-release diff --git a/gulp-appdmg.js b/gulp-appdmg.js new file mode 100644 index 000000000..f3128c79e --- /dev/null +++ b/gulp-appdmg.js @@ -0,0 +1,31 @@ + +const appdmg = require('appdmg'); +const through = require('through2'); +const gutil = require('gulp-util'); + +const PluginError = gutil.PluginError; +const PLUGIN_NAME = 'gulp-appdmg'; + +module.exports = function(options) { + const stream = through.obj(function(file, encoding, next) { + next(); + }, function(callback) { + const self = this; + const ee = appdmg(options); + + ee.on('progress', function(info) { + gutil.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; +}; diff --git a/gulp-macdmg.js b/gulp-macdmg.js deleted file mode 100644 index cf667d34b..000000000 --- a/gulp-macdmg.js +++ /dev/null @@ -1,30 +0,0 @@ -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; -}; diff --git a/gulpfile.js b/gulpfile.js index 8a6ede4e4..d6bed50d5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -677,9 +677,7 @@ function release_osx64() { console.log('running locally - skipping signing of app'); } - //var appdmg = require('gulp-appdmg'); - const appdmg = require('./gulp-macdmg'); - + const appdmg = require('./gulp-appdmg'); // The appdmg does not generate the folder correctly, manually createDirIfNotExists(RELEASE_DIR); @@ -688,16 +686,12 @@ function release_osx64() { return gulp.src(['.']) .pipe(appdmg({ target: path.join(RELEASE_DIR, getReleaseFilename('macOS', 'dmg')), - basepath: path.join(APPS_DIR, pkg.name, 'osx64'), + basepath: path.join(appDirectory, metadata.name, 'osx64'), specification: { - 'title': 'Emuflight Configurator', - //'icon': 'assets/osx/app-icon.icns', // FIXME - 'icon-size': 128, - 'background': path.join(__dirname, 'assets/osx/dmg-background.png'), - 'contents': [ + title: 'Emuflight Configurator', + contents: [ { 'x': 180, 'y': 590, 'type': 'file', 'path': pkg.name + '.app', 'name': 'Emuflight Configurator.app' }, { 'x': 570, 'y': 590, 'type': 'link', 'path': '/Applications' } - ], background: path.join(__dirname, 'assets/osx/dmg-background.png'), format: 'UDZO', @@ -707,7 +701,6 @@ function release_osx64() { height: 755 } }, - //'code-sign': { 'signing-identity': process.env.APP_IDENTITY } }, }) ); diff --git a/package.json b/package.json index cd6539da9..b9814f8f1 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "yarn": "1.22" }, "optionalDependencies": { - "appdmg": "^0.6.6" + "appdmg": "0.6.6", + "macos-alias": "^0.2.11" } } diff --git a/yarn.lock b/yarn.lock index c65a69b7a..ce5a45245 100644 --- a/yarn.lock +++ b/yarn.lock @@ -234,10 +234,10 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -appdmg@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/appdmg/-/appdmg-0.6.0.tgz#81b3beab624ab458e6104d87c5cfa4b172203821" - integrity sha512-vDz8cMf5c6BfoS72OmmHzzuxG5DFVDM6YCAkscjYh3GASGEBBRCZ10Bn515ZPSPHOpfI9Xu3MlApbd49C58pJg== +appdmg@0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/appdmg/-/appdmg-0.6.6.tgz#d06bd82b530032fd7a8f0970a1c6ee6196e1efce" + integrity sha512-GRmFKlCG+PWbcYF4LUNonTYmy0GjguDy6Jh9WP8mpd0T6j80XIJyXBiWlD0U+MLNhqV9Nhx49Gl9GpVToulpLg== dependencies: async "^1.4.2" ds-store "^0.1.5" @@ -251,10 +251,10 @@ appdmg@^0.6.0: path-exists "^4.0.0" repeat-string "^1.5.4" -appdmg@^0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/appdmg/-/appdmg-0.6.6.tgz#d06bd82b530032fd7a8f0970a1c6ee6196e1efce" - integrity sha512-GRmFKlCG+PWbcYF4LUNonTYmy0GjguDy6Jh9WP8mpd0T6j80XIJyXBiWlD0U+MLNhqV9Nhx49Gl9GpVToulpLg== +appdmg@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/appdmg/-/appdmg-0.6.0.tgz#81b3beab624ab458e6104d87c5cfa4b172203821" + integrity sha512-vDz8cMf5c6BfoS72OmmHzzuxG5DFVDM6YCAkscjYh3GASGEBBRCZ10Bn515ZPSPHOpfI9Xu3MlApbd49C58pJg== dependencies: async "^1.4.2" ds-store "^0.1.5" @@ -3548,10 +3548,10 @@ lru_map@^0.3.3: resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= -macos-alias@~0.2.5: +macos-alias@^0.2.11, macos-alias@~0.2.5: version "0.2.11" resolved "https://registry.yarnpkg.com/macos-alias/-/macos-alias-0.2.11.tgz#feeea6c13ba119814a43fc43c470b31e59ef718a" - integrity sha1-/u6mwTuhGYFKQ/xDxHCzHlnvcYo= + integrity sha512-zIUs3+qpml+w3wiRuADutd7XIO8UABqksot10Utl/tji4UxZzLG4fWDC+yJZoO8/Ehg5RqsvSRE/6TS5AEOeWw== dependencies: nan "^2.4.0"