Skip to content

Commit

Permalink
fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mebays committed Jun 1, 2023
1 parent fdd6de6 commit aad04da
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
69 changes: 35 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ jobs:
node update.js
- name: Get yarn cache directory path
id: yarn-cache-dir-path
id: npm-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
uses: nick-fields/retry@v2
Expand All @@ -66,12 +66,13 @@ jobs:
retry_on: error
command: |
cd lens
yarn install --frozen-lockfile
npm run all:install
- name: Build Linux Lens
working-directory: lens
run: |
yarn run build:app
# when installing dependencies lens specifies a specific version of npm
npx npm run build:app
shell: bash
if: ${{ runner.os == 'Linux' }}
env:
Expand All @@ -80,7 +81,7 @@ jobs:
- name: Build macOS Lens
working-directory: lens
run: |
yarn run build:app
npx npm run build:app
shell: bash
if: ${{ runner.os == 'macOS' }}
env:
Expand All @@ -89,7 +90,7 @@ jobs:
- name: Build Windows Lens
working-directory: lens
run: |
yarn run build:app
npx npm run build:app
shell: bash
if: ${{ runner.os == 'Windows' }}
env:
Expand All @@ -101,27 +102,27 @@ jobs:
run: certutil -hashfile OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe SHA256 | tee OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe.sha256
shell: bash
if: ${{ runner.os == 'Windows' }}
working-directory: lens/packages/open-lens/dist
working-directory: lens/open-lens/dist

- name: Calculate Linux and Mac checksum
run: for filename in OpenLens-${{ steps.version.outputs.LENS_VERSION }}*; do shasum -a 256 ${filename} | tee ${filename}.sha256 ; done
shell: bash
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
working-directory: lens/packages/open-lens/dist
working-directory: lens/open-lens/dist

- uses: actions/upload-artifact@v3
if: github.ref != 'refs/heads/main'
with:
name: OpenLens-${{ matrix.os }}
retention-days: 5
path: |
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.dmg
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.AppImage
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.deb
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.rpm
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.zip
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.sha256
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.dmg
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.AppImage
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.deb
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.rpm
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.zip
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.sha256
- name: Generate Changelog
run: curl -s https://api.github.com/repos/lensapp/lens/releases/tags/v${{ steps.version.outputs.LENS_VERSION }} | jq -r '.body' > ${{ github.workspace }}-CHANGELOG.txt
Expand All @@ -133,13 +134,13 @@ jobs:
tag_name: v${{ steps.version.outputs.LENS_VERSION }}
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: |
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.dmg
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.AppImage
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.deb
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.rpm
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.zip
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe
lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.sha256
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.dmg
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.AppImage
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.deb
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.rpm
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.zip
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe
lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.sha256
# Commenting out due to the need to install extensions after upgrading
# after a version. This seemed safer than publishing to the auto upgrade
Expand All @@ -151,11 +152,11 @@ jobs:
## with:
## tag_name: Latest
## files: |
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.dmg
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.AppImage
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.deb
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.rpm
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.zip
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe
## lens/packages/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.sha256
## lens/packages/open-lens/dist/lates*.yml
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.dmg
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.AppImage
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.deb
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.rpm
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.zip
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}.exe
## lens/open-lens/dist/OpenLens-${{ steps.version.outputs.LENS_VERSION }}*.sha256
## lens/open-lens/dist/lates*.yml
4 changes: 2 additions & 2 deletions update.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const packagePath = './lens/packages/open-lens/package.json';
const packagePath = './lens/open-lens/package.json';

var packagejson = require(packagePath);

Expand All @@ -11,4 +11,4 @@ packagejson.build.publish = [{
// This updates the naming of the artifact to not contain spaces vs the default 'OpenLens Setup ${version}.${ext}'
packagejson.build.win.artifactName = "OpenLens-${version}.${ext}";

fs.writeFileSync(packagePath, JSON.stringify(packagejson));
fs.writeFileSync(packagePath, JSON.stringify(packagejson, null, 2));

0 comments on commit aad04da

Please sign in to comment.