Merge branch 'master' into pr/170

This commit is contained in:
confused-Techie 2023-08-31 23:23:49 -07:00
commit 6f1cd600e0
5 changed files with 106 additions and 19 deletions

View File

@ -36,6 +36,8 @@ env:
# - yarn run build:apm
# build_binary_script:
# - yarn dist || yarn dist
# rename_binary_script:
# - node script/rename.js "Linux"
# binary_artifacts:
# path: ./binaries/*
# test_script:
@ -54,7 +56,8 @@ env:
arm_linux_task:
alias: linux
only_if: $CIRRUS_CRON != "" || $CIRRUS_TAG == "regular_release"
only_if: $CIRRUS_CRON != "" || $CIRRUS_TAG != ""
skip: $CIRRUS_CHANGE_IN_REPO == $CIRRUS_LAST_GREEN_CHANGE
arm_container:
image: node:16-slim
memory: 8G
@ -93,6 +96,8 @@ arm_linux_task:
- yarn run build:apm
build_binary_script:
- yarn dist || yarn dist
rename_binary_script:
- node script/rename.js "ARM.Linux"
binary_artifacts:
path: ./binaries/*
test_script:
@ -114,7 +119,8 @@ arm_linux_task:
silicon_mac_task:
alias: mac
only_if: $CIRRUS_CRON != "" || $CIRRUS_TAG == "regular_release"
only_if: $CIRRUS_CRON != "" || $CIRRUS_TAG != ""
skip: $CIRRUS_CHANGE_IN_REPO == $CIRRUS_LAST_GREEN_CHANGE
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
memory: 8G
@ -142,12 +148,15 @@ silicon_mac_task:
build_binary_script:
- export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH"
- yarn dist || yarn dist
rename_binary_script:
- export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH"
- node script/rename.js "Silicon.Mac"
binary_artifacts:
path: ./binaries/*
test_script:
- export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH"
- rm -R node_modules/electron; yarn install --check-files
- hdiutil mount binaries/Pulsar*dmg
- hdiutil mount binaries/*Pulsar*dmg
- export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar`
- PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list
rolling_upload_script:
@ -195,12 +204,15 @@ silicon_mac_task:
# build_binary_script:
# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
# - arch -x86_64 npx yarn dist || arch -x86_64 npx yarn dist
# rename_binary_script:
# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
# - node script/rename.js "Intel.Mac"
# binary_artifacts:
# path: ./binaries/*
# test_script:
# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
# - rm -R node_modules/electron; yarn install --check-files
# - hdiutil mount binaries/Pulsar*dmg
# - hdiutil mount binaries/*Pulsar*dmg
# - export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar`
# - PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml arch -x86_64 npx playwright test --reporter=junit,list
# always:
@ -236,6 +248,8 @@ silicon_mac_task:
# build_binary_script:
# - sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json
# - npx yarn dist || npx yarn dist || npx yarn dist
# rename_binary_script:
# - node script/rename.js "Windows"
# binary_artifacts:
# path: .\binaries\*
# test_script:

View File

@ -73,8 +73,10 @@ jobs:
yarn run build:apm
# macOS Signing Stuff
- name: Build Pulsar Binaries (macOS)
if: ${{ runner.os == 'macOS' }}
- name: Build Pulsar Binaries (macOS) (Signed)
if: ${{ runner.os == 'macOS' && github.event.pull_request.head.repo.full_name == 'pulsar-edit/pulsar' }}
# PRs generated from forks cannot access GitHub Secrets
# So if the PR is a fork, we will still build, but will not sign.
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
@ -88,6 +90,15 @@ jobs:
retry_on: error
command: yarn dist
- name: Build Pulsar Binaries (macOS) (Unsigned)
if: ${{ runner.os == 'macOS' && github.event.pull_request.head.repo.full_name != 'pulsar-edit/pulsar' }}
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
with:
timeout_minutes: 30
max_attempts: 3
retry_on: error
command: yarn dist
- name: Build Pulsar Binaries
if: ${{ runner.os != 'macOS' }}
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
@ -97,6 +108,18 @@ jobs:
retry_on: error
command: yarn dist
- name: Rename Pulsar Binaries for Regular release (Linux)
if: ${{ runner.os == 'Linux' }}
run: node ./script/rename.js "Linux"
- name: Rename Pulsar Binaries for Regular release (macOS)
if: ${{ runner.os == 'macOS' }}
run: node ./script/rename.js "Intel.Mac"
- name: Rename Pulsar Binaries for Regular release (Windows)
if: ${{ runner.os == 'Windows' }}
run: node ./script/rename.js "Windows"
- name: Upload Binary Artifacts
uses: actions/upload-artifact@v3
with:
@ -125,7 +148,7 @@ jobs:
run: |
export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH"
rm -R node_modules/electron; yarn install --check-files
hdiutil mount binaries/Pulsar*dmg
hdiutil mount binaries/*Pulsar*dmg
export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar`
PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml arch -x86_64 npx playwright test --reporter=junit,list

View File

@ -148,12 +148,6 @@ export default class InstalledPackagesPanel extends CollapsibleSectionPanel {
packages.core = packages.core.filter(({theme}) => !theme)
packages.git = (packages.git || []).filter(({theme}) => !theme)
for (let pack of packages.core) {
if (pack.repository == null) {
pack.repository = `https://github.com/pulsar-edit/${pack.name}`
}
}
for (let packageType of ['dev', 'core', 'user', 'git']) {
for (let pack of packages[packageType]) {
pack.owner = ownerFromRepository(pack.repository)

View File

@ -200,12 +200,6 @@ export default class ThemesPanel extends CollapsibleSectionPanel {
packages.core = packages.core.filter(({theme}) => theme)
packages.git = (packages.git || []).filter(({theme}) => theme)
for (let pack of packages.core) {
if (pack.repository == null) {
pack.repository = `https://github.com/pulsar-edit/${pack.name}`
}
}
for (let packageType of ['dev', 'core', 'user', 'git']) {
for (let pack of packages[packageType]) {
pack.owner = ownerFromRepository(pack.repository)

62
script/rename.js Normal file
View File

@ -0,0 +1,62 @@
try {
console.log("Starting the binary renaming script...");
const fs = require('fs');
const prefix = process.argv[2];
const pulsarVersion = require('../package.json').version;
const versionSegments = pulsarVersion.split('.');
const lastSegment = versionSegments[versionSegments.length - 1];
// Detecting Rolling release version strings
if (lastSegment.length > 4) {
// For example, '1-dev' is longer than 4 characters,
// and the format like '2023081600' from CI is longer than 4 characters.
// Either of those would indicate Rolling, not Regular.
console.log(`Based on the version string in package.json (${pulsarVersion}),`);
console.log('we are *not* preparing a Regular release, so *not* renaming any binaries.');
console.log('Exiting the binary renaming script.');
process.exit(0);
}
// Warn about required prefix as first argument.
// If prefix was not provided, print warning and do nothing else,
// exiting "cleanly" with status 0.
if (typeof prefix !== "string" || prefix.length === 0) {
console.log("A prefix is required. Pass the desired prefix as the first argument to this script.");
console.log('Example usage: "node script/rename.js Windows"');
console.log('or: "node script/rename.js ARM.Linux"');
console.log("Exiting the binary renaming script.");
process.exit(0);
}
console.log(`Based on the version string in package.json (${pulsarVersion}),`);
console.log('we *are* preparing a Regular release, so *renaming all binaries with prefixes*.');
console.log(`Prefix is: ${prefix}`);
// Renaming files under ./binaries/* that haven't already been renamed...
const fileNames = fs.readdirSync('./binaries');
fileNames.forEach((file) => {
console.log(`Existing filename is: ${file}`);
// We use 'starting with "p" or "P"' as the heuristic for whether or not
// the file has already been renamed (and thus prefixed) before.
if (file.startsWith('p') || file.startsWith('P')) {
let dest = `${prefix}.${file}`
// Replace any spaces with periods in the resulting filenames
dest = dest.replace(/ /g,".");
console.log(`Renaming file from "${file}" to "${dest}"`);
fs.renameSync(`./binaries/${file}`, `./binaries/${dest}`);
} else {
console.log('Filename does not start with "p" or "P". Skipping...');
};
});
} catch (e) {
console.error("There was a problem during the renaming script!:");
console.error(e);
};