-
Notifications
You must be signed in to change notification settings - Fork 271
120 lines (103 loc) · 4.22 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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 --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