Fix npmrc file and build commands

This commit is contained in:
Muhammed 2023-03-16 11:17:26 +03:00
parent 0c24991f21
commit c7fa4c2e9e
2 changed files with 14 additions and 9 deletions

View File

@ -3,9 +3,9 @@ name: Build Lens
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: [ main ] branches: [main]
paths-ignore: paths-ignore:
- '**/README.md' - "**/README.md"
pull_request: pull_request:
jobs: jobs:
@ -20,8 +20,8 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- 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:
@ -50,7 +50,7 @@ jobs:
if [ "${CSC_KEY_PASSWORD}" = "" ]; then if [ "${CSC_KEY_PASSWORD}" = "" ]; then
unset CSC_KEY_PASSWORD unset CSC_KEY_PASSWORD
fi fi
yarn yarn run all:install
yarn run build yarn run build
yarn run build:app yarn run build:app
for file in packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.dmg; do for file in packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.dmg; do
@ -68,7 +68,7 @@ jobs:
fi fi
done done
elif [ "$RUNNER_OS" == "Linux" ]; then elif [ "$RUNNER_OS" == "Linux" ]; then
yarn yarn run all:install
yarn run build yarn run build
yarn run build:app yarn run build:app
cp packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.x86_64.AppImage releasefiles/OpenLens-${{ env.LENS_VERSION }}.AppImage cp packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.x86_64.AppImage releasefiles/OpenLens-${{ env.LENS_VERSION }}.AppImage
@ -78,7 +78,7 @@ jobs:
cp packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.arm64.deb releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.deb cp packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.arm64.deb releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.deb
cp packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.aarch64.rpm releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.rpm cp packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}.aarch64.rpm releasefiles/OpenLens-${{ env.LENS_VERSION }}.arm64.rpm
else else
yarn yarn run all:install
yarn run build yarn run build
yarn run build:app yarn run build:app
cp packages/open-lens/dist/OpenLens*.exe releasefiles/OpenLens-${{ env.LENS_VERSION }}.exe cp packages/open-lens/dist/OpenLens*.exe releasefiles/OpenLens-${{ env.LENS_VERSION }}.exe
@ -130,7 +130,7 @@ jobs:
with: with:
tag_name: v${{ env.LENS_VERSION }} tag_name: v${{ env.LENS_VERSION }}
body_path: ${{ github.workspace }}-CHANGELOG.txt body_path: ${{ github.workspace }}-CHANGELOG.txt
files: | files: |
lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.dmg lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.dmg
lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.AppImage lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.AppImage
lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.deb lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.deb
@ -143,7 +143,7 @@ jobs:
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
with: with:
tag_name: Latest tag_name: Latest
files: | files: |
lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.dmg lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.dmg
lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.AppImage lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.AppImage
lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.deb lens/packages/open-lens/dist/OpenLens-${{ env.LENS_VERSION }}*.deb

View File

@ -15,3 +15,8 @@ if (process.platform != "win32") {
} }
fs.writeFileSync('./lens/packages/open-lens/package.json', JSON.stringify(packagejson)); fs.writeFileSync('./lens/packages/open-lens/package.json', JSON.stringify(packagejson));
let npmrc = fs.readFileSync('./.npmrc','utf-8');
npmrc = npmrc.replace("disturl \"","disturl = \"")
npmrc = npmrc.replace("target \"","target = \"")
npmrc = npmrc.replace("runtime \"","runtime = \"")
fs.writeFileSync('./.npmrc',npmrc)