Run nx instead yarn
This commit is contained in:
parent
77a6205469
commit
4062b09783
|
|
@ -21,11 +21,11 @@ jobs:
|
||||||
- name: Export version to variable
|
- name: Export version to variable
|
||||||
run: |
|
run: |
|
||||||
export LENS_VERSION=$(cat version)
|
export LENS_VERSION=$(cat version)
|
||||||
echo "LENS_VERSION=$LENS_VERSION" >> $GITHUB_ENV
|
echo "LENS_VERSION=$LENS_VERSION" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.19.0
|
node-version: "16.x"
|
||||||
- name: Checkout Upstream Lens
|
- name: Checkout Upstream Lens
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -42,6 +42,12 @@ jobs:
|
||||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
choco install visualstudio2019buildtools visualstudio2019-workload-vctools
|
choco install visualstudio2019buildtools visualstudio2019-workload-vctools
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
npm run all:install
|
||||||
|
# Avoid npm install from electron-builder
|
||||||
|
# ref: https://github.com/electron-userland/electron-builder/blob/80a3ae857b9305aff1774e1b2b932601af50231b/packages/app-builder-lib/src/util/yarn.ts#L11-L16
|
||||||
|
mkdir open-lens/node_modules
|
||||||
|
|
||||||
if [ "$RUNNER_OS" == "macOS" ]; then
|
if [ "$RUNNER_OS" == "macOS" ]; then
|
||||||
if [ "${CSC_LINK}" = "" ]; then
|
if [ "${CSC_LINK}" = "" ]; then
|
||||||
unset CSC_LINK
|
unset CSC_LINK
|
||||||
|
|
@ -50,10 +56,9 @@ jobs:
|
||||||
if [ "${CSC_KEY_PASSWORD}" = "" ]; then
|
if [ "${CSC_KEY_PASSWORD}" = "" ]; then
|
||||||
unset CSC_KEY_PASSWORD
|
unset CSC_KEY_PASSWORD
|
||||||
fi
|
fi
|
||||||
echo "DOWNLOAD_ALL_ARCHITECTURES=true" >> $GITHUB_ENV
|
|
||||||
yarn run all:install
|
npx nx run open-lens:build:app --x64 --arm64
|
||||||
yarn run build
|
|
||||||
yarn run build:app
|
|
||||||
for file in open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.dmg; do
|
for file in open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.dmg; do
|
||||||
if [[ "$file" == *"arm64"* ]]; then
|
if [[ "$file" == *"arm64"* ]]; then
|
||||||
cp "$file" releasefiles/OpenLens-${{ env.LENS_VERSION }}-arm64.dmg
|
cp "$file" releasefiles/OpenLens-${{ env.LENS_VERSION }}-arm64.dmg
|
||||||
|
|
@ -69,10 +74,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
elif [ "$RUNNER_OS" == "Linux" ]; then
|
elif [ "$RUNNER_OS" == "Linux" ]; then
|
||||||
echo "DOWNLOAD_ALL_ARCHITECTURES=true" >> $GITHUB_ENV
|
npx nx run open-lens:build:app --x64 --arm64
|
||||||
yarn run all:install
|
|
||||||
yarn run build
|
|
||||||
yarn run build:app
|
|
||||||
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.x86_64.AppImage releasefiles/OpenLens-${{ env.LENS_VERSION }}.AppImage
|
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.x86_64.AppImage releasefiles/OpenLens-${{ env.LENS_VERSION }}.AppImage
|
||||||
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.amd64.deb releasefiles/OpenLens-${{ env.LENS_VERSION }}.deb
|
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.amd64.deb releasefiles/OpenLens-${{ env.LENS_VERSION }}.deb
|
||||||
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.x86_64.rpm releasefiles/OpenLens-${{ env.LENS_VERSION }}.rpm
|
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.x86_64.rpm releasefiles/OpenLens-${{ env.LENS_VERSION }}.rpm
|
||||||
|
|
@ -80,9 +82,8 @@ jobs:
|
||||||
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.arm64.deb releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.deb
|
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.arm64.deb releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.deb
|
||||||
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.aarch64.rpm releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.rpm
|
cp open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.aarch64.rpm releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.rpm
|
||||||
else
|
else
|
||||||
yarn run all:install
|
unset DOWNLOAD_ALL_ARCHITECTURES
|
||||||
yarn run build
|
npx nx run open-lens:build:app
|
||||||
yarn run build:app
|
|
||||||
cp open-lens/dist/OpenLens*.exe releasefiles/OpenLens-${{ env.LENS_VERSION }}.exe
|
cp open-lens/dist/OpenLens*.exe releasefiles/OpenLens-${{ env.LENS_VERSION }}.exe
|
||||||
cp open-lens/dist/OpenLens*.exe open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.exe
|
cp open-lens/dist/OpenLens*.exe open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.exe
|
||||||
fi
|
fi
|
||||||
|
|
@ -99,6 +100,7 @@ jobs:
|
||||||
WIN_CSC_LINK: ${{ secrets.CSC_LINK_WIN }}
|
WIN_CSC_LINK: ${{ secrets.CSC_LINK_WIN }}
|
||||||
WIN_CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD_WIN }}
|
WIN_CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD_WIN }}
|
||||||
CSC_FOR_PULL_REQUEST: true
|
CSC_FOR_PULL_REQUEST: true
|
||||||
|
DOWNLOAD_ALL_ARCHITECTURES: true
|
||||||
|
|
||||||
- name: Calculate SHA256 checksum
|
- name: Calculate SHA256 checksum
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
13
update.js
13
update.js
|
|
@ -8,17 +8,6 @@ packagejson.build.publish = [{
|
||||||
}];
|
}];
|
||||||
|
|
||||||
packagejson.build.win.artifactName = "OpenLens.Setup.${version}.${ext}";
|
packagejson.build.win.artifactName = "OpenLens.Setup.${version}.${ext}";
|
||||||
|
packagejson.build.npmRebuild = true;
|
||||||
if (process.platform != "win32") {
|
|
||||||
// build both x86_64 and arm64 for Linux and Darwin
|
|
||||||
packagejson.scripts['build:app'] = "electron-builder --publish onTag --x64 --arm64";
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync('./lens/open-lens/package.json', JSON.stringify(packagejson));
|
fs.writeFileSync('./lens/open-lens/package.json', JSON.stringify(packagejson));
|
||||||
|
|
||||||
|
|
||||||
let npmrc = fs.readFileSync('./lens/.npmrc','utf-8');
|
|
||||||
npmrc = npmrc.replace("disturl \"","disturl = \"")
|
|
||||||
npmrc = npmrc.replace("target \"","target = \"")
|
|
||||||
npmrc = npmrc.replace("runtime \"","runtime = \"")
|
|
||||||
fs.writeFileSync('./lens/.npmrc',npmrc)
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue