From e9f490f076af946f3f985dbea406fc17d1c33223 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Wed, 26 Jul 2023 08:57:12 +0200 Subject: [PATCH 1/4] ci: Add windows.bat and change gitlab-ci for build with wine runner. --- .gitlab-ci.yml | 86 +++++++++++++++++++++++++------------------- packages/windows.bat | 20 +++++++++++ 2 files changed, 70 insertions(+), 36 deletions(-) create mode 100644 packages/windows.bat diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5e670bc1..90bc7c9e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - test + - package - release ######### @@ -12,11 +13,16 @@ build: script: - echo "TODO build pamhyr" -# build-lang: -# stage: build -# script: -# - cd ./src/lang/ -# - ./create_ts.sh +build-lang: + stage: build + tags: + - linux + script: + - cd ./src/lang/ + - ./create_ts.sh + artifacts: + paths: + - src/lang/*.qm ######### # TESTS # @@ -32,56 +38,64 @@ test: ############ linux-package: - stage: release + stage: package tags: - release - linux - rules: - - if: $CI_COMMIT_BRANCH == 'master' - - if: $CI_COMMIT_TAG - when: never + needs: + - job: build-lang + artifacts: true + # rules: + # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG + # when: never artifacts: paths: - # - packages/pamhyr-src.tar.gz - packages/pamhyr-gnulinux-amd64.tar.xz script: - cd packages - ./linux.sh -# windows-package: -# stage: release -# tags: -# - release -# - wine -# rules: -# - if: $CI_COMMIT_BRANCH == 'master' -# - if: $CI_COMMIT_TAG -# when: never -# artifacts: -# paths: -# - packages/pamhyr-win-amd64.zip -# - packages/pamhyr-win-amd64.exe -# script: -# - cd packages -# - ./wine.sh ci +windows-package: + stage: package + tags: + - release + - wine + needs: + - job: build-lang + artifacts: true + # rules: + # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG + # when: never + artifacts: + paths: + - packages/pamhyr-win-amd64.exe + script: + - cd packages + - ./windows.bat + +########### +# RELEASE # +########### tag-release: stage: release tags: - release - linux - - wine + needs: + - job: linux-package + artifacts: true + - job: windows-package + artifacts: true rules: - if: $CI_COMMIT_TAG artifacts: paths: - packages/pamhyr-gnulinux-amd64.tar.xz - # - packages/pamhyr-win-amd64.zip - # - packages/pamhyr-win-amd64.exe script: - cd packages - - ./linux.sh - # - ./wine.sh ci + # - ./linux.sh + # # - ./wine.sh ci release: name: '$CI_COMMIT_TAG' description: 'Automatic release from tag $CI_COMMIT_TAG' @@ -97,7 +111,7 @@ tag-release: # url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.zip' # filepath: '/packages/pamhyr-win-amd64.zip' # link_type: 'Packages' - # - name: 'Windows amd64 (exe)' - # url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.exe' - # filepath: '/packages/pamhyr-win-amd64.exe' - # link_type: 'Packages' + - name: 'Windows amd64 (exe)' + url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.exe' + filepath: '/packages/pamhyr-win-amd64.exe' + link_type: 'other' diff --git a/packages/windows.bat b/packages/windows.bat new file mode 100644 index 00000000..42c46ba0 --- /dev/null +++ b/packages/windows.bat @@ -0,0 +1,20 @@ +rem Windows batch for pamhyr windows version building +@ECHO ON + +rem Python environment +python -m pip install -r ..\requirements.txt + +rem Build windows version +pyinstaller ..\src\pamhyr.py -y + +rem Copy data +mkdir dist\pamhyr\View\ui\ressources +mkdir dist\pamhyr\View\ui\Widgets + +copy /y ..\src\View\ui\ressources\ dist\pamhyr\View\ui\ressources +copy /y ..\src\View\ui\Widgets\*.ui dist\pamhyr\View\ui\Widgets +copy /y ..\src\View\ui\*.ui dist\pamhyr\View\ui\ +copy /y ..\src\lang\*.qm dist\pamhyr\lang\ + +rem Make installer +"C:\Program Files (x86)\NSIS\makensis.exe" pamhyr.nsi From 41961a786e6fb43728153f640ddb4ae30c8d9dbf Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Wed, 26 Jul 2023 11:41:23 +0200 Subject: [PATCH 2/4] ci: Disable windows build. --- .gitlab-ci.yml | 51 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90bc7c9e..ec641795 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,23 +55,23 @@ linux-package: - cd packages - ./linux.sh -windows-package: - stage: package - tags: - - release - - wine - needs: - - job: build-lang - artifacts: true - # rules: - # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG - # when: never - artifacts: - paths: - - packages/pamhyr-win-amd64.exe - script: - - cd packages - - ./windows.bat +# windows-package: +# stage: package +# tags: +# - release +# - wine +# needs: +# - job: build-lang +# artifacts: true +# # rules: +# # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG +# # when: never +# artifacts: +# paths: +# - packages/pamhyr-win-amd64.exe +# script: +# - cd packages +# - ./windows.bat ########### # RELEASE # @@ -85,13 +85,14 @@ tag-release: needs: - job: linux-package artifacts: true - - job: windows-package - artifacts: true + # - job: windows-package + # artifacts: true rules: - if: $CI_COMMIT_TAG artifacts: paths: - packages/pamhyr-gnulinux-amd64.tar.xz + - packages/pamhyr-win-amd64.exe script: - cd packages # - ./linux.sh @@ -107,11 +108,7 @@ tag-release: url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-gnulinux-amd64.tar.xz' filepath: '/packages/pamhyr-gnulinux-amd64.tar.xz' link_type: 'other' - # - name: 'Windows amd64 (zip)' - # url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.zip' - # filepath: '/packages/pamhyr-win-amd64.zip' - # link_type: 'Packages' - - name: 'Windows amd64 (exe)' - url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.exe' - filepath: '/packages/pamhyr-win-amd64.exe' - link_type: 'other' + # - name: 'Windows amd64 (exe)' + # url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.exe' + # filepath: '/packages/pamhyr-win-amd64.exe' + # link_type: 'other' From 25a01682d400c83636fbce7ae76cd9c4022e20e7 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Wed, 26 Jul 2023 17:03:18 +0200 Subject: [PATCH 3/4] ci: Enable windows package. --- .gitlab-ci.yml | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec641795..da4feb5c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,23 +55,23 @@ linux-package: - cd packages - ./linux.sh -# windows-package: -# stage: package -# tags: -# - release -# - wine -# needs: -# - job: build-lang -# artifacts: true -# # rules: -# # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG -# # when: never -# artifacts: -# paths: -# - packages/pamhyr-win-amd64.exe -# script: -# - cd packages -# - ./windows.bat +windows-package: + stage: package + tags: + - release + - wine + needs: + - job: build-lang + artifacts: true + # rules: + # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG + # when: never + artifacts: + paths: + - packages/pamhyr-win-amd64.exe + script: + - cd packages + - ./windows.bat ########### # RELEASE # @@ -85,8 +85,8 @@ tag-release: needs: - job: linux-package artifacts: true - # - job: windows-package - # artifacts: true + - job: windows-package + artifacts: true rules: - if: $CI_COMMIT_TAG artifacts: @@ -108,7 +108,7 @@ tag-release: url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-gnulinux-amd64.tar.xz' filepath: '/packages/pamhyr-gnulinux-amd64.tar.xz' link_type: 'other' - # - name: 'Windows amd64 (exe)' - # url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.exe' - # filepath: '/packages/pamhyr-win-amd64.exe' - # link_type: 'other' + - name: 'Windows amd64 (exe)' + url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/packages/pamhyr-win-amd64.exe' + filepath: '/packages/pamhyr-win-amd64.exe' + link_type: 'other' From 86d022dc9368df087502c33436792db62ab3e609 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Wed, 26 Jul 2023 17:14:05 +0200 Subject: [PATCH 4/4] ci: Active rules for packages. --- .gitlab-ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da4feb5c..5bb9624c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,9 +45,8 @@ linux-package: needs: - job: build-lang artifacts: true - # rules: - # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG - # when: never + rules: + - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG artifacts: paths: - packages/pamhyr-gnulinux-amd64.tar.xz @@ -63,9 +62,8 @@ windows-package: needs: - job: build-lang artifacts: true - # rules: - # - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG - # when: never + rules: + - if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG artifacts: paths: - packages/pamhyr-win-amd64.exe @@ -95,8 +93,6 @@ tag-release: - packages/pamhyr-win-amd64.exe script: - cd packages - # - ./linux.sh - # # - ./wine.sh ci release: name: '$CI_COMMIT_TAG' description: 'Automatic release from tag $CI_COMMIT_TAG'