Skip to content

Commit

Permalink
drop snapcraft build until we can confirm resolution (#203)
Browse files Browse the repository at this point in the history
* drop snapcraft build until we can confirm resolution

* remove workaround in package step
  • Loading branch information
shiftkey committed Apr 16, 2020
1 parent 9b63345 commit f9326c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
1 change: 0 additions & 1 deletion script/electron-builder-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ linux:
target:
- deb
- rpm
- snap
- AppImage
maintainer: 'GitHub, Inc <opensource+desktop@github.com>'
deb:
Expand Down
54 changes: 1 addition & 53 deletions script/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import * as path from 'path'
import * as crypto from 'crypto'
import * as electronInstaller from 'electron-winstaller'
import * as glob from 'glob'
import * as YAML from 'yaml'
const rimraf = require('rimraf')

import { getProductName, getCompanyName, getVersion } from '../app/package-info'
import { getProductName, getCompanyName } from '../app/package-info'
import {
getDistPath,
getDistRoot,
Expand Down Expand Up @@ -148,54 +146,6 @@ function getSha256Checksum(fullPath: string): Promise<string> {
})
}

function throwIfError(command: string, args: string[]) {
const { error } = cp.spawnSync(command, args, { stdio: 'inherit' })

if (error != null) {
throw error
}
}

function workaroundForSnapPackage() {
const distRoot = getDistRoot()

const snapArchive = path.join(
distRoot,
`GitHubDesktop-linux-${getVersion()}.snap`
)
const snapFileSystem = path.join(distRoot, 'unsquashfs-root')

throwIfError('unsquashfs', [
'-dest',
snapFileSystem,
'-no-progress',
snapArchive,
])

const snapMetaYaml = path.join(snapFileSystem, 'meta', 'snap.yaml')

const yamlText = fs.readFileSync(snapMetaYaml, 'utf8')
const yaml = YAML.parse(yamlText)

// regenerate the YAML without whatever electron-builder has included for the plugs
// element, because a package using the strict enclosure should not define this
const yamlWithoutPlugs = {
...yaml,
apps: {
'github-desktop': {
command: 'command.sh',
},
},
}

const newYaml = YAML.stringify(yamlWithoutPlugs)
fs.writeFileSync(snapMetaYaml, newYaml, 'utf8')

throwIfError('snapcraft', ['pack', snapFileSystem, '--output', snapArchive])

rimraf.sync(snapFileSystem)
}

function generateChecksums() {
const distRoot = getDistRoot()

Expand Down Expand Up @@ -252,7 +202,5 @@ function packageLinux() {
throw error
}

workaroundForSnapPackage()

generateChecksums()
}

0 comments on commit f9326c7

Please sign in to comment.