-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (144 loc) · 6.02 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build Lens
on:
schedule:
- cron: '20 */6 * * *'
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-2019, ubuntu-20.04, macos-11]
node-version: [16.x]
runs-on: ${{ matrix.os }}
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Export version to variable
id: version
run: |
echo "LENS_VERSION=$(cat version)" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout Lens
uses: actions/checkout@v3
with:
repository: lensapp/lens
fetch-depth: 1
path: lens
ref: v${{ steps.version.outputs.LENS_VERSION }}
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Update Lens
run: |
node update.js
- name: Get yarn cache directory path
id: npm-cache-dir-path
shell: bash
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 3
retry_on: error
command: |
cd lens
npm run all:install
- name: Build Linux Lens
working-directory: lens
run: |
# when installing dependencies lens specifies a specific version of npm
npx npm run build:app
shell: bash
if: ${{ runner.os == 'Linux' }}
env:
ELECTRON_BUILDER_EXTRA_ARGS: "--x64 --arm64"
- name: Build macOS Lens
working-directory: lens
run: |
npx npm run build:app
shell: bash
if: ${{ runner.os == 'macOS' }}
env:
ELECTRON_BUILDER_EXTRA_ARGS: "--x64 --arm64"
- name: Build Windows Lens
working-directory: lens
run: |
npx npm run build:app
shell: bash
if: ${{ runner.os == 'Windows' }}
env:
ELECTRON_BUILDER_EXTRA_ARGS: "--x64"
CSC_LINK: ${{ secrets.WIN_CERT_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_PASS }}
- name: Calculate Window checksum
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/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/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-${{ 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
- name: Release
uses: softprops/action-gh-release@v0.1.15
if: github.ref == 'refs/heads/main'
with:
tag_name: v${{ steps.version.outputs.LENS_VERSION }}
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: |
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
# link.
#
##- 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-${{ 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