116 lines
3.9 KiB
YAML
116 lines
3.9 KiB
YAML
name: Build Lens
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- "**/README.md"
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-20.04, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 360
|
|
env:
|
|
BUILD_ID: ${{ github.run_number }}
|
|
steps:
|
|
- name: Checkout OpenLens
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Export version to variable
|
|
run: echo "LENS_VERSION=$(cat version)" >> $GITHUB_ENV
|
|
shell: bash
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16.x"
|
|
|
|
- name: Checkout Upstream Lens
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: lensapp/lens
|
|
path: lens
|
|
ref: v${{ env.LENS_VERSION }}
|
|
fetch-depth: 1
|
|
|
|
- name: Patch Upstream Lens
|
|
run: node update.js
|
|
|
|
- name: Build Lens
|
|
run: |
|
|
npm run all:install
|
|
|
|
if [ "${CSC_LINK}" = "" ] || [ "${CSC_KEY_PASSWORD}" = "" ]; then
|
|
unset CSC_LINK
|
|
unset CSC_KEY_PASSWORD
|
|
fi
|
|
|
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
|
npx nx run open-lens:build:app --win nsis msi portable
|
|
elif [ "$RUNNER_OS" == "Linux" ]; then
|
|
npx nx run open-lens:build:app --x64 --arm64
|
|
find . -name '*pty.node' -print0 | xargs -0 file
|
|
else
|
|
npx nx run open-lens:build:app --x64 --arm64
|
|
find . -name '*pty.node' -print0 | xargs -0 file
|
|
fi
|
|
|
|
rm -f open-lens/dist/*blockmap{,*}
|
|
shell: bash
|
|
working-directory: lens
|
|
env:
|
|
APPBUNDLEID: "io.kontena.lens-app"
|
|
APPLEID: ${{ secrets.APPLEID }}
|
|
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
|
|
CSC_LINK: ${{ runner.os == 'macos' && secrets.CSC_LINK || secrets.CSC_LINK_WIN }}
|
|
CSC_KEY_PASSWORD: ${{ runner.os == 'macos' && secrets.CSC_KEY_PASSWORD || secrets.CSC_KEY_PASSWORD_WIN }}
|
|
CSC_LINK_WIN: ${{ secrets.CSC_LINK_WIN }}
|
|
CSC_KEY_PASSWORD_WIN: ${{ secrets.CSC_KEY_PASSWORD_WIN }}
|
|
WIN_CSC_LINK: ${{ secrets.CSC_LINK_WIN }}
|
|
WIN_CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD_WIN }}
|
|
CSC_FOR_PULL_REQUEST: true
|
|
DOWNLOAD_ALL_ARCHITECTURES: ${{ runner.os != 'Windows' }}
|
|
DEBUG: electron-rebuild
|
|
- name: Calculate SHA256 checksum
|
|
run: |-
|
|
if command -v shasum 2>/dev/null 1>&2; then
|
|
for filename in OpenLens*; do shasum -a 256 "${filename}" | tee "${filename}.sha256" ; done
|
|
else
|
|
for filename in OpenLens*; do certutil -hashfile "${filename}" SHA256 | tee "${filename}.sha256" ; done
|
|
fi
|
|
|
|
shell: bash
|
|
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/open-lens/dist/OpenLens*${{ env.LENS_VERSION }}-${{ env.BUILD_NUMBER }}*.*
|
|
|
|
- name: Generate Changelog
|
|
run: curl -s https://api.github.com/repos/lensapp/lens/releases/latest | jq -r 'select(.prerelease == false) | .body[0:]' > ${{ github.workspace }}-CHANGELOG.txt
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v0.1.15
|
|
if: github.ref == 'refs/heads/main'
|
|
with:
|
|
tag_name: v${{ env.LENS_VERSION }}-${{ env.BUILD_NUMBER }}
|
|
body_path: ${{ github.workspace }}-CHANGELOG.txt
|
|
files: lens/open-lens/dist/OpenLens*${{ env.LENS_VERSION }}-${{ env.BUILD_NUMBER }}*.*
|
|
|
|
- name: Latest
|
|
uses: softprops/action-gh-release@v0.1.15
|
|
if: github.ref == 'refs/heads/main'
|
|
with:
|
|
tag_name: Latest
|
|
files: |
|
|
lens/open-lens/dist/OpenLens*${{ env.LENS_VERSION }}-${{ env.BUILD_NUMBER }}*.*
|
|
lens/open-lens/dist/lates*.yml
|