Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Cleanup building #35

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- name: Bump Version
run: |
sed -i 's/VERSION = .*/VERSION = ${{ github.event.inputs.version }}/' Makefile
export VERSION=${{ github.event.inputs.version }}
make bump-version
- name: Create PR
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ jobs:
cache: true
- name: build
run: |
qmake
make
make build-linux
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: minikube-gui-linux
path: ./minikube
path: ./minikube-gui-linux.tar.gz
8 changes: 2 additions & 6 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ jobs:
cache: true
- name: build
run: |
qmake
make
- name: package
run: |
macdeployqt ./minikube.app -qmldir=. -verbose=1 -dmg
make build-macos
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: minikube-gui-macos
path: ./minikube.dmg
path: ./minikube-gui-macos.dmg
24 changes: 3 additions & 21 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
cache: true
- name: build
run: |
qmake
make
tar -czvf minikube-gui-linux.tar.gz ./minikube
make build-linux
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: minikube-gui-linux-release
Expand All @@ -36,12 +34,7 @@ jobs:
cache: true
- name: build
run: |
qmake
make
- name: package
run: |
macdeployqt ./minikube.app -qmldir=. -verbose=1 -dmg
mv ./minikube.dmg ./minikube-gui-macos.dmg
make build-macos
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: minikube-gui-macos-release
Expand All @@ -56,18 +49,7 @@ jobs:
- name: build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
qmake
nmake
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
- name: package
shell: pwsh
run: |
& scripts\windows-publish.ps1 minikube-gui-windows minikube.exe
Compress-Archive -Path minikube-gui-windows minikube-gui-windows.zip
make build-windows
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: minikube-gui-windows-release
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,8 @@ jobs:
- name: build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
qmake
nmake
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
- name: package
shell: pwsh
run: |
& scripts\windows-publish.ps1 minikube-gui-windows minikube.exe
make build-windows
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: minikube-gui-windows
path: ./minikube-gui-windows
path: ./minikube-gui-windows.zip
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
*build-*
*.qm
*.prl

Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION = 0.0.2
.PHONY: build-linux
build-linux:
qmake
make
tar -czvf minikube-gui-linux.tar.gz -C ./bin ./minikube-gui

.PHONY: build-macos
build-macos:
qmake
make
(cd ./bin && macdeployqt ./minikube-gui.app -qmldir=. -verbose=1 -dmg)
mv ./bin/minikube-gui.dmg ./minikube-gui-macos.dmg

.PHONY: build-windows
build-windows:
scripts\build-windows.cmd

.PHONY: bump-version
bump-version:
Expand Down
2 changes: 2 additions & 0 deletions minikube.pro
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ SOURCES = src/main.cpp \
src/window.cpp
RESOURCES = minikube.qrc
ICON = resources/images/minikube.icns
TARGET = minikube-gui
DESTDIR = bin

QT += widgets network
requires(qtConfig(combobox))
Expand Down
4 changes: 4 additions & 0 deletions scripts/build-windows.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
qmake
nmake
powershell scripts\bundle-windows.ps1 minikube-gui-windows minikube-gui.exe
39 changes: 39 additions & 0 deletions scripts/bundle-windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2023 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[CmdletBinding()]
param (
[string] $archiveName, [string] $targetName
)

$scriptDir = $PSScriptRoot
$currentDir = Get-Location
Write-Host "currentDir" $currentDir
Write-Host "scriptDir" $scriptDir

function Main() {
New-Item -ItemType Directory $archiveName
Copy-Item bin\$targetName $archiveName\
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName
$excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
Remove-Item -Path $archiveName -Include $excludeList -Recurse -Force
$redistDll="{0}{1}\*.CRT\*.dll" -f $env:VCToolsRedistDir.Trim(),$env:msvcArch
Copy-Item $redistDll $archiveName\
$sdkDll="{0}Redist\{1}ucrt\DLLs\{2}\*.dll" -f $env:WindowsSdkDir.Trim(),$env:WindowsSdkVersion.Trim(),$env:msvcArch
Copy-Item $sdkDll $archiveName\
Compress-Archive -Path minikube-gui-windows minikube-gui-windows.zip
}
Main


30 changes: 0 additions & 30 deletions scripts/windows-publish.ps1

This file was deleted.