Skip to content

Commit

Permalink
Merge pull request #3540 from fritzing/develop
Browse files Browse the repository at this point in the history
Merge versioning and travis build config
  • Loading branch information
KjellMorgenstern authored Oct 8, 2019
2 parents 3d82419 + b0243dc commit 2b85bbe
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 93 deletions.
36 changes: 18 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ stages:
- name: fast_check
- name: build_and_pack
# Avoid duplicate builds for pull requests
if: type = push OR (type = pull_request AND slug != "fritzing/fritzing-app")
if: type = push OR (type = pull_request AND repo != "fritzing/fritzing-app")
- name: deploy_to_github
if: type = push AND branch IN (develop, master)
if: type = push AND branch IN (develop, master) AND repo = "fritzing/fritzing-app"

env:
global:
Expand All @@ -28,7 +28,7 @@ jobs:
services:
- docker
before_install:
- docker pull fritzing/build:xenial
- docker pull fritzing/build:bionic
script:
- docker/build-linux.sh

Expand All @@ -42,8 +42,8 @@ jobs:
- tools/aws_tasks.sh setup
- docker pull fritzing/build:xenial
script:
- docker/release-linux.sh xenial $TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.xenial
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.xenial.linux.AMD64.tar.bz2
- docker/release-linux.sh xenial $TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.xenial
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.xenial.linux.AMD64.tar.bz2

after_success:
- tools/aws_tasks.sh synchronize_up
Expand All @@ -58,8 +58,8 @@ jobs:
- tools/aws_tasks.sh setup
- docker pull fritzing/build:bionic
script:
- docker/release-linux.sh bionic $TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.bionic
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.bionic.linux.AMD64.tar.bz2
- docker/release-linux.sh bionic $TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.bionic
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.bionic.linux.AMD64.tar.bz2

after_success:
- tools/aws_tasks.sh synchronize_up
Expand All @@ -74,8 +74,8 @@ jobs:
- tools/aws_tasks.sh setup
- docker pull fritzing/build:fedora-30
script:
- docker/release-linux.sh fedora-30 $TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.fedora-30
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.fedora-30.linux.AMD64.tar.bz2
- docker/release-linux.sh fedora-30 $TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.fedora-30
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.fedora-30.linux.AMD64.tar.bz2

after_success:
- tools/aws_tasks.sh synchronize_up
Expand Down Expand Up @@ -103,8 +103,8 @@ jobs:
script:
- ls /usr/local/opt
- tools/deploy_fritzing_mac.sh
- mv ../deploy-app/Fritzing.dmg fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.mojave.10.2.dmg
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.mojave.10.2.dmg
- mv ../deploy-app/Fritzing.dmg fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.mojave.10.2.dmg
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.mojave.10.2.dmg

after_success:
- tools/aws_tasks.sh synchronize_up
Expand Down Expand Up @@ -134,8 +134,8 @@ jobs:
script:
- ls /usr/local/opt
- tools/deploy_fritzing_mac.sh
- mv ../deploy-app/Fritzing.dmg fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.high_sierra.10.1.dmg
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.high_sierra.10.1.dmg
- mv ../deploy-app/Fritzing.dmg fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.high_sierra.10.1.dmg
- tools/aws_tasks.sh store_with_md5 . fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.high_sierra.10.1.dmg

after_success:
- tools/aws_tasks.sh synchronize_up
Expand All @@ -153,8 +153,8 @@ jobs:
- tools/aws_tasks.sh setup

script:
- tools/build-windows.bat "$TRAVIS_COMMIT"-debug-continuous-"$TRAVIS_BUILD_NUMBER"
- tools/aws_tasks.sh store_with_md5 $TRAVIS_BUILD_DIR/../release64 fritzing-$TRAVIS_COMMIT-debug-continuous-$TRAVIS_BUILD_NUMBER.windows.64.zip
- tools/build-windows.bat "$TRAVIS_COMMIT"-$TRAVIS_BRANCH-"$TRAVIS_BUILD_NUMBER"
- tools/aws_tasks.sh store_with_md5 $TRAVIS_BUILD_DIR/../release64 fritzing-$TRAVIS_COMMIT-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.windows.64.zip

after_success:
- tools/aws_tasks.sh synchronize_up
Expand All @@ -174,10 +174,10 @@ jobs:
secure: "ndzX3gAwth3jsLQobNvYZKERGsP6OjsLNIj/CiIw1eGzJn9Di6bB0aksIBiRU8Sp5zGdMUjxiQk/qgZg/vnce+oUiQM8c1PFgGh1b04W57M8NnnGYsfMa9b8kgEzlmlpP4qSD6SlG5FI29JuOAQqQWHD3ywnsy9tiu5dn84k735gLfTnuIzFmQgvl5zil8G2kMSLMY0EIC8bgWbn8JRsEfBqF7FvbJOmmsww/ADRJx2z6iOhOmTu23qZOIq6GNG8MTyp0jW6yZsNP0Nyum966pqsu6cwyHVuXA4iIRBgE1022PoQfN9F7cLiuskl33xbl5FoKQS7iw7W3wUH0vmyd3XuiBBpoDz2A2iPghMS/7Z31T5rCWgWb9SDDelScz3y9ESlabmmOBVEx633eWtrXG5poiMLJshLyR3d+uCm5C5fIyPn++CxwMkBR/anWMJBlCYX8CYSLBJd5Kz+J/vvc6XTgm1D4+oUYBcrhRs3fiRlKY72RHLy8V3b9ji+oIpnz5ZqguSS1WpF74T+zESyb/dtL0dfAewxmQg1XdOzcmRgWP80Uc3Mxb3laImrBJLSPXi0eR0V5Y0n6RVub3FQOhzNx5+s0jaGbzYJJScKC1eOLbupdSuKEUOG5n4I8IsHTzr3EIzhMyI7vSK0w4bKVdSxLYuVcXV8Bf9Kc+7yZvg="
file_glob: true
file: $HOME/$TRAVIS_BUILD_NUMBER/*
on:
repo: fritzing/fritzing-app
branch: develop
skip_cleanup: true
# We already check the branch in the stage condition
on:
all_branches: true

after_deploy:
- tools/aws_tasks.sh cleanup
9 changes: 9 additions & 0 deletions docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ USER conan
# No SHA verification for now. Will be automated by Conan in the future.
RUN set -xe \
&& wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj

RUN set -xe \
&& wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz \
&& mv libgit2-0.28.1 libgit2 \
&& mkdir libgit2/build \
&& cd libgit2/build \
&& cmake -D BUILD_SHARED_LIBS=OFF .. \
&& cmake --build . -- -j4 \
&& cd ../../
5 changes: 4 additions & 1 deletion docker/release-linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
set -xe

docker run --privileged -v "$(pwd):/home/conan/fritzing" -w /home/conan/fritzing fritzing/build:"$1" docker/xvfb-release-helper.sh "$2"
docker run --privileged -v "$(pwd):/home/conan/fritzing" \
-e TRAVIS="${TRAVIS:-}" \
-e TRAVIS_BUILD_NUMBER="${TRAVIS_BUILD_NUMBER:-}" \
-w /home/conan/fritzing fritzing/build:"$1" docker/xvfb-release-helper.sh "$2"
15 changes: 3 additions & 12 deletions phoenix.pro
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,9 @@ QT += concurrent core gui network printsupport serialport sql svg widgets xml
RC_FILE = fritzing.rc
RESOURCES += phoenixresources.qrc

# Fritzing is using libgit2 since version 0.9.3
packagesExist(libgit2) {
message("always true on win32. leads to build problems")

PKGCONFIG += libgit2
win32 {
include(pri/libgit2detect.pri)
message($$PKGCONFIG)
}
} else {
include(pri/libgit2detect.pri)
}
# Disable this if you have (and want) libgit2 dynamically
LIBGIT_STATIC = true
include(pri/libgit2detect.pri)

include(pri/boostdetect.pri)

Expand Down
32 changes: 32 additions & 0 deletions pri/gitversion.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Need to discard STDERR so get path to NULL device
win32 {
NULL_DEVICE = NUL # Windows doesn't have /dev/null but has NUL
} else {
NULL_DEVICE = /dev/null
}

# Need to call git with manually specified paths to repository
BASE_GIT_COMMAND = git --git-dir $$PWD/../.git --work-tree $$PWD/..

$$(TRAVIS) {
# When running on travis, the tag is created *after* the build was successful.
# So we can not use 'git describe', but we generate a string that should look exactly
# like what git describe would deliver
GIT_VERSION = CD-$$(TRAVIS_BUILD_NUMBER)-0-$$system($$BASE_GIT_COMMAND rev-parse --short HEAD)
} else {
GIT_VERSION = $$system($$BASE_GIT_COMMAND describe --tags 2> $$NULL_DEVICE)
}

GIT_DATE = $$system($$BASE_GIT_COMMAND show --no-patch --no-notes --pretty='%cd' HEAD --date=iso-strict 2> $$NULL_DEVICE)

# Here we process the build date and time
win32 {
# Try to squeeze something ISO-8601-ish out of windows
BUILD_DATE = $$system( powershell (Get-Date -Format "o") )
} else {
BUILD_DATE = $$system( date --iso-8601=seconds )
}

DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
DEFINES += GIT_DATE=\\\"$$GIT_DATE\\\"
DEFINES += BUILD_DATE=\\\"$$BUILD_DATE\\\"
51 changes: 33 additions & 18 deletions pri/libgit2detect.pri
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@
# along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
# ********************************************************************

LIBGIT2INCLUDE = "$$_PRO_FILE_PWD_/../libgit2/include"
exists($$LIBGIT2INCLUDE/git2.h) {
message("found libgit2 include path at $$LIBGIT2INCLUDE")
} else {
message("Fritzing requires libgit2")
message("Build it from the repo at https://github.com/libgit2")
message("See https://github.com/fritzing/fritzing-app/wiki for details.")

error("libgit2 include path not found in $$LIBGIT2INCLUDE")
packagesExist(libgit2) {
} else {
LIBGIT_STATIC = true
}

INCLUDEPATH += $$LIBGIT2INCLUDE
if ($$LIBGIT_STATIC) {
LIBGIT2INCLUDE = "$$_PRO_FILE_PWD_/../libgit2/include"
exists($$LIBGIT2INCLUDE/git2.h) {
message("found libgit2 include path at $$LIBGIT2INCLUDE")
} else {
message("Fritzing requires libgit2")
message("Build it from the repo at https://github.com/libgit2")
message("See https://github.com/fritzing/fritzing-app/wiki for details.")

error("libgit2 include path not found in $$LIBGIT2INCLUDE")
}

INCLUDEPATH += $$LIBGIT2INCLUDE
}

win32 {
contains(QMAKE_TARGET.arch, x86_64) {
Expand All @@ -40,18 +48,25 @@ win32 {
}

LIBS += -L$$LIBGIT2LIB -lgit2
message($$PKGCONFIG)
}

unix {
LIBGIT2LIB = $$_PRO_FILE_PWD_/../libgit2/build
exists($$LIBGIT2LIB/libgit2.a) {
message("found libgit2 library in $$LIBGIT2LIB")
} else {
error("static libgit2 library not found in $$LIBGIT2LIB")
}
macx {
LIBS += $$LIBGIT2LIB/libgit2.a /System/Library/Frameworks/Security.framework/Versions/A/Security
if ($$LIBGIT_STATIC) {
LIBGIT2LIB = $$_PRO_FILE_PWD_/../libgit2/build
exists($$LIBGIT2LIB/libgit2.a) {
message("found libgit2 library in $$LIBGIT2LIB")
} else {
error("static libgit2 library not found in $$LIBGIT2LIB")
}
macx {
LIBS += $$LIBGIT2LIB/libgit2.a /System/Library/Frameworks/Security.framework/Versions/A/Security
} else {
LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto
}
} else {
LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto
warning("Using dynamic linking for libgit2.")
#message("Enabled dynamic linking of libgit2")
PKGCONFIG += libgit2
}
}
10 changes: 5 additions & 5 deletions pri/translations.pri
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TRANSLATIONS += translations/fritzing_de.ts \
translations/fritzing_bg.ts \
translations/fritzing_bn.ts \
translations/fritzing_cs.ts \
translations/fritzing_da.ts \
translations/fritzing_da.ts \
translations/fritzing_el.ts \
translations/fritzing_en.ts \
translations/fritzing_es.ts \
Expand All @@ -32,7 +32,7 @@ TRANSLATIONS += translations/fritzing_de.ts \
translations/fritzing_it.ts \
translations/fritzing_ja.ts \
translations/fritzing_ko.ts \
translations/fritzing_mk.ts \
translations/fritzing_mk.ts \
translations/fritzing_mr.ts \
translations/fritzing_nl.ts \
translations/fritzing_pl.ts \
Expand All @@ -42,12 +42,12 @@ TRANSLATIONS += translations/fritzing_de.ts \
translations/fritzing_ru.ts \
translations/fritzing_sk.ts \
translations/fritzing_sl.ts \
translations/fritzing_sr.ts \
translations/fritzing_sr.ts \
translations/fritzing_sv.ts \
translations/fritzing_th.ts \
translations/fritzing_tr.ts \
translations/fritzing_uk.ts \
translations/fritzing_ur.ts \
translations/fritzing_vi.ts \
translations/fritzing_ur.ts \
translations/fritzing_vi.ts \
translations/fritzing_zh_cn.ts \
translations/fritzing_zh_tw.ts \
12 changes: 7 additions & 5 deletions pri/version.pri
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
# along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
# ********************************************************************/

include(gitversion.pri)

HEADERS += \
src/version/modfiledialog.h \
src/version/modfiledialog.h \
src/version/updatedialog.h \
src/version/version.h \
src/version/versionchecker.h \
src/version/partschecker.h
src/version/partschecker.h

SOURCES += \
src/version/modfiledialog.cpp \
src/version/modfiledialog.cpp \
src/version/updatedialog.cpp \
src/version/version.cpp \
src/version/versionchecker.cpp \
src/version/partschecker.cpp
src/version/partschecker.cpp

FORMS += \
src/version/modfiledialog.ui
src/version/modfiledialog.ui
Binary file modified resources/images/aboutbox_scrollfade.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/splash/april1st.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions resources/images/splash/splash.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<splash sliceDelaySeconds="0" >
<item id="progress" x="0" y="224" />
<item id="fritzingText" x="5" y="222" width="516" height="20" color="#eaf4ed" />
<item id="versionText" x="0" y="222" width="549" height="20" color="#eaf4ed" />
<item id="fritzingText" x="5" y="224" width="516" height="20" color="#eaf4ed" />
<item id="versionText" x="0" y="224" width="563" height="20" color="#eaf4ed" />
<item id="logoBar" x="0" y="157" />
<item id="slice" x="0" y="0" />
</splash>
Binary file modified resources/images/splash/splash_progressbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/splash/splash_screen_start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/fapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,13 +1380,13 @@ void FApplication::initSplash(FSplashScreen & splash) {
splash.showMessage(msg1, "fritzingText", Qt::AlignLeft | Qt::AlignTop);

QString msg2 = QObject::tr("<font face='Lucida Grande, Tahoma, Sans Serif' size='2' color='#eaf4ed'>"
"Version %1.%2.%3 (%4%5) %6"
"Version %1.%2.%3 (%4 %5) %6"
"</font>")
.arg(Version::majorVersion())
.arg(Version::minorVersion())
.arg(Version::minorSubVersion())
.arg(Version::modifier())
.arg(Version::shortDate())
.arg(Version::gitVersion())
.arg(Version::date())
.arg(m_buildType);
splash.showMessage(msg2, "versionText", Qt::AlignRight | Qt::AlignTop);

Expand Down
Loading

0 comments on commit 2b85bbe

Please sign in to comment.