mirror of
https://github.com/MuhammedKalkan/OpenLens.git
synced 2026-10-08 19:42:39 +02:00
Cancel builds
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
name: Check latest Lens version
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '15 */6 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
version_check:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
- name: Get the latest version of Lens
|
||||
run: |
|
||||
curl -s https://api.github.com/repos/lensapp/lens/releases | jq -r '[.[] | select(.prerelease == false)][0] | .tag_name[1:]' > version
|
||||
echo "LENS_VERSION=$(cat version)" >> $GITHUB_ENV
|
||||
- name: Add & Commit
|
||||
uses: EndBug/add-and-commit@v9.1.1
|
||||
with:
|
||||
message: 'Version updated to: ${{ env.LENS_VERSION }}'
|
||||
@@ -0,0 +1,26 @@
|
||||
name: Clear Latest
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths-ignore:
|
||||
- '**/README.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Clean Latest
|
||||
uses: mknejp/delete-release-assets@v1
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
tag: Latest
|
||||
fail-if-no-assets: false
|
||||
fail-if-no-release: false
|
||||
assets: |
|
||||
*.*
|
||||
@@ -0,0 +1,120 @@
|
||||
name: Build Lens
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "**/README.md"
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
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
|
||||
# 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 -p open-lens/node_modules
|
||||
|
||||
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
|
||||
sudo apt update
|
||||
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
|
||||
|
||||
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' }}
|
||||
|
||||
- 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_ID }}*.*
|
||||
|
||||
- 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_ID }}
|
||||
body_path: ${{ github.workspace }}-CHANGELOG.txt
|
||||
files: lens/open-lens/dist/OpenLens*${{ env.LENS_VERSION }}-${{ env.BUILD_ID }}*.*
|
||||
|
||||
- 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_ID }}*.*
|
||||
#lens/open-lens/dist/lates*.yml
|
||||
Reference in New Issue
Block a user