Skip to content

Commit 391e690

Browse files
committed
Merge branch 'main' into feat/configurable-verification-rule
2 parents 706ccc9 + 5f0bb58 commit 391e690

136 files changed

Lines changed: 4076 additions & 932 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
# linux disabled until we get to work to support it
14-
#platform: [macos-latest, ubuntu-20.04, windows-latest]
15-
platform: [macos-latest, windows-latest]
13+
# There is a bug on Ubuntu 22.04 (ubuntu-latest) regarding stripping a binary for a different
14+
# architecture. Since we include both x86_64 and arm64 in linux a solution is to use ubuntu 20.04
15+
# https://github.com/electron/forge/issues/3102
16+
# https://github.com/electron/forge/issues/3701
17+
platform: [macos-latest, windows-latest, ubuntu-20.04]
1618

1719
runs-on: ${{ matrix.platform }}
1820
steps:
@@ -91,6 +93,22 @@ jobs:
9193
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
9294
run: npm run publish
9395

96+
- name: publish Linux
97+
if: startsWith(matrix.platform, 'ubuntu-')
98+
env:
99+
NODE_OPTIONS: '--max_old_space_size=8192'
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
# sentry integration
102+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
103+
# sentry vite plugin integration during build
104+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
105+
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
106+
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
107+
run: |
108+
sudo apt install -y rpm
109+
npm run publish
110+
npm run publish -- --arch=arm64
111+
94112
- name: cleanup macos certificates
95113
if: startsWith(matrix.platform, 'macos-')
96114
run: |

forge.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ function getPlatformSpecificResources() {
1616
// Otherwise the x86_64 build will still be having the resources/arm64 only binaries
1717
if (getPlatform() === 'mac') {
1818
return ['./resources/mac/arm64', './resources/mac/x86_64']
19+
} else if (getPlatform() === 'linux') {
20+
return ['./resources/linux/arm64', './resources/linux/x86_64']
1921
}
2022

2123
return [path.join('./resources/', getPlatform(), getArch())]
2224
}
2325

2426
const config: ForgeConfig = {
2527
packagerConfig: {
28+
name: 'Grafana k6 Studio',
29+
executableName: 'k6-studio',
2630
icon: './resources/icons/logo',
2731
asar: true,
2832
extraResource: [
@@ -64,9 +68,8 @@ const config: ForgeConfig = {
6468
},
6569
['darwin']
6670
),
67-
new MakerRpm({}),
68-
new MakerRpm({}),
69-
new MakerDeb({ options: { icon: './src/assets/icons/logo.png' } }),
71+
new MakerRpm({ options: { icon: './resources/icons/logo.png' } }),
72+
new MakerDeb({ options: { icon: './resources/icons/logo.png' } }),
7073
],
7174
plugins: [
7275
new VitePlugin({

install-k6.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const K6_VERSION = 'v0.55.0'
55
const K6_PATH_MAC_AMD = `k6-${K6_VERSION}-macos-amd64`
66
const K6_PATH_MAC_ARM = `k6-${K6_VERSION}-macos-arm64`
77
const K6_PATH_WIN_AMD = `k6-${K6_VERSION}-windows-amd64`
8+
const K6_PATH_LINUX_AMD = `k6-${K6_VERSION}-linux-amd64`
9+
const K6_PATH_LINUX_ARM = `k6-${K6_VERSION}-linux-arm64`
810

911
const getMacOSK6Binary = () => {
1012
const command = `
@@ -52,6 +54,32 @@ Remove-Item -Path "${K6_PATH_WIN_AMD}" -Recurse
5254
execSync(command, { shell: 'powershell.exe' })
5355
}
5456

57+
const getLinuxK6Binary = () => {
58+
const command = `
59+
# download binaries
60+
curl -LO https://github.com/grafana/k6/releases/download/${K6_VERSION}/${K6_PATH_LINUX_AMD}.tar.gz
61+
curl -LO https://github.com/grafana/k6/releases/download/${K6_VERSION}/${K6_PATH_LINUX_ARM}.tar.gz
62+
63+
# unzip & smoke test
64+
tar -zxf ${K6_PATH_LINUX_AMD}.tar.gz
65+
tar -zxf ${K6_PATH_LINUX_ARM}.tar.gz
66+
${K6_PATH_LINUX_AMD}/k6 version
67+
# ${K6_PATH_LINUX_ARM}/k6 version ## if we move to separate images for architectures we could test this one as well
68+
69+
# move to resource folder
70+
mv ${K6_PATH_LINUX_AMD}/k6 resources/linux/x86_64
71+
mv ${K6_PATH_LINUX_ARM}/k6 resources/linux/arm64
72+
73+
# cleanup
74+
rm ${K6_PATH_LINUX_AMD}.tar.gz
75+
rm ${K6_PATH_LINUX_ARM}.tar.gz
76+
rmdir ${K6_PATH_LINUX_AMD}
77+
rmdir ${K6_PATH_LINUX_ARM}
78+
`
79+
80+
execSync(command)
81+
}
82+
5583
switch (process.platform) {
5684
case 'darwin':
5785
// we check only for one arch since we include both binaries
@@ -70,6 +98,15 @@ switch (process.platform) {
7098
console.log('k6 binary download completed')
7199
}
72100
break
101+
case 'linux':
102+
// we check only for one arch since we include both binaries
103+
if (!existsSync('resources/linux/x86_64/k6')) {
104+
console.log('k6 binary not found')
105+
console.log('downloading k6... this might take some time...')
106+
getLinuxK6Binary()
107+
console.log('k6 binary download completed')
108+
}
109+
break
73110
default:
74111
console.log(`unsupported platform found: ${process.platform}`)
75112
}

0 commit comments

Comments
 (0)