Make it generate tar.gz file for linux #367
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --linux rpm deb tar.gz --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 |