From 7756f75bb9dd090c46639a74dcaf6d1f2c5694b6 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sat, 1 Jul 2023 20:18:26 +0200 Subject: [PATCH 01/13] Test Release Action --- .github/workflows/publish-release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..d8996d8 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,23 @@ +on: + push: + branches: [main] +# tags: +# - 'v(\d|\.)*' +name: "Publish Release" +jobs: + publish-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v2.27.0 + with: + workflow: windows.yml + workflow_conclusion: success + + - name: "Publish Release" + uses: softprops/action-gh-release@v0.1.15 + with: + files: "Cartridges Setup.exe" \ No newline at end of file From c5449015192da48fe7ee8d71e86a178706b47ae7 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 00:51:28 +0200 Subject: [PATCH 02/13] =?UTF-8?q?I'm=20one=20with=20the=20cloud=20?= =?UTF-8?q?=E2=98=81=EF=B8=8F=20(#130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{windows.yml => ci.yml} | 33 +++++++++++-- .github/workflows/flatpak-builder.yml | 19 -------- .github/workflows/publish-release.yml | 58 ++++++++++++++++------- .pylintrc | 1 - CONTRIBUTING.md | 2 +- README.md | 2 +- 6 files changed, 70 insertions(+), 45 deletions(-) rename .github/workflows/{windows.yml => ci.yml} (60%) delete mode 100644 .github/workflows/flatpak-builder.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/ci.yml similarity index 60% rename from .github/workflows/windows.yml rename to .github/workflows/ci.yml index f2ebcf5..8d1fb44 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/ci.yml @@ -2,20 +2,41 @@ on: push: branches: [main] pull_request: -name: "Build for Windows" +name: CI +concurrency: + group: release-${{ github.sha }} jobs: + flatpak: + name: "Flatpak" + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-44 + options: --privileged + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Flatpak Builder + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: hu.kramo.Cartridges.Devel.flatpak + manifest-path: flatpak/hu.kramo.Cartridges.Devel.json + cache-key: flatpak-builder-${{ github.sha }} + windows: - name: "Build" + name: Build for Windows runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v3 - - name: MSYS2 + + - name: Setup MSYS2 uses: msys2/setup-msys2@v2 with: msystem: UCRT64 update: true install: mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-libadwaita mingw-w64-ucrt-x86_64-python-gobject mingw-w64-ucrt-x86_64-python-yaml mingw-w64-ucrt-x86_64-python-requests mingw-w64-ucrt-x86_64-python-pillow mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-ca-certificates mingw-w64-ucrt-x86_64-meson git + - name: Compile shell: msys2 {0} run: | @@ -23,10 +44,12 @@ jobs: ninja -C _build install pacman --noconfirm -Rs mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-meson git find /ucrt64/share/locale/ -type f ! -name "*cartridges.mo" -delete + - name: "Inno Setup" run: iscc ".\_build\Cartridges.iss" + - name: "Upload Artifact" uses: actions/upload-artifact@v3 with: - name: "Installer" - path: "_build/Output/Cartridges Setup.exe" \ No newline at end of file + name: Windows Installer + path: _build/Output/Cartridges Setup.exe \ No newline at end of file diff --git a/.github/workflows/flatpak-builder.yml b/.github/workflows/flatpak-builder.yml deleted file mode 100644 index c868945..0000000 --- a/.github/workflows/flatpak-builder.yml +++ /dev/null @@ -1,19 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: CI -jobs: - flatpak: - name: "Flatpak" - runs-on: ubuntu-latest - container: - image: bilelmoussaoui/flatpak-github-actions:gnome-44 - options: --privileged - steps: - - uses: actions/checkout@v3 - - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 - with: - bundle: hu.kramo.Cartridges.Devel.flatpak - manifest-path: flatpak/hu.kramo.Cartridges.Devel.json - cache-key: flatpak-builder-${{ github.sha }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index d8996d8..e8d6bdc 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,23 +1,45 @@ on: - push: - branches: [main] -# tags: -# - 'v(\d|\.)*' -name: "Publish Release" + push: + tags: + "*" +name: Publish Release +concurrency: + group: release-${{ github.sha }} jobs: publish-release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 + name: Publish Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 - - name: Download workflow artifact - uses: dawidd6/action-download-artifact@v2.27.0 - with: - workflow: windows.yml - workflow_conclusion: success + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v2.27.0 + with: + workflow: ci.yml + commit: ${{ github.sha }} - - name: "Publish Release" - uses: softprops/action-gh-release@v0.1.15 - with: - files: "Cartridges Setup.exe" \ No newline at end of file + - name: Get release notes + shell: python + run: | + import re, textwrap + open_file = open("./data/hu.kramo.Cartridges.metainfo.xml.in", "r", encoding="utf-8") + string = open_file.read() + open_file.close() + string = re.findall("\s*\n([\s\S]*?)\s*\s*<\/release>", string)[0] + string = textwrap.dedent(string) + open_file = open("release_notes", "w", encoding="utf-8") + open_file.write(string) + open_file.close() + + - name: Get tag name + id: get_tag_name + run: echo tag_name=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT + + - name: Publish release + uses: softprops/action-gh-release@v0.1.15 + with: + files: Windows Installer/Cartridges Setup.exe + fail_on_unmatched_files: true + tag_name: ${{ steps.get_tag_name.outputs.tag_name }} + body_path: release_notes \ No newline at end of file diff --git a/.pylintrc b/.pylintrc index e2f5b68..fd9f7f3 100644 --- a/.pylintrc +++ b/.pylintrc @@ -2,7 +2,6 @@ ignore=importers - [MESSAGES CONTROL] disable=raw-checker-failed, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2589760..d59fffa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ The project can be translated on [Weblate](https://hosted.weblate.org/engage/car ## For Windows 1. Install [MSYS2](https://www.msys2.org/). -2. From the MSYS2 shell, install the required dependencies listed [here](https://github.com/kra-mo/cartridges/blob/main/.github/workflows/windows.yml). +2. From the MSYS2 shell, install the required dependencies listed [here](https://github.com/kra-mo/cartridges/blob/main/.github/workflows/ci.yml). 3. Build it via Meson. ## Meson diff --git a/README.md b/README.md index 54aa241..0f148d9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ [circle-url]: https://circle.gnome.org [circle-image]: https://circle.gnome.org/assets/button/badge.svg [github-actions-url]: https://github.com/kra-mo/cartridges -[github-actions-image]: https://github.com/kra-mo/cartridges/actions/workflows/flatpak-builder.yml/badge.svg +[github-actions-image]: https://github.com/kra-mo/cartridges/actions/workflows/ci.yml/badge.svg [code-style-url]: https://github.com/psf/black [code-style-image]: https://img.shields.io/badge/code%20style-black-000000?style=flat [weblate-url]: https://hosted.weblate.org/engage/cartridges/ From 8fadcc8524d03255ab5ed57bcfb7bc71aa637a62 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 00:53:20 +0200 Subject: [PATCH 03/13] oops --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index fd9f7f3..57a45cc 100644 --- a/.pylintrc +++ b/.pylintrc @@ -4,6 +4,7 @@ ignore=importers [MESSAGES CONTROL] + disable=raw-checker-failed, bad-inline-option, locally-disabled, From c2f429a29cf2b64fb0af3a266bd81d9254ffe1ab Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 00:57:54 +0200 Subject: [PATCH 04/13] Fix Flatpak action caching --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d1fb44..f55dcce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,10 @@ jobs: uses: actions/checkout@v3 - name: Flatpak Builder - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1 with: bundle: hu.kramo.Cartridges.Devel.flatpak manifest-path: flatpak/hu.kramo.Cartridges.Devel.json - cache-key: flatpak-builder-${{ github.sha }} windows: name: Build for Windows From a7393ba9b9b30eadfba8f2b115a9a9822885edf4 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 01:25:08 +0200 Subject: [PATCH 05/13] Rename Windows Action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f55dcce..26ab88e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: manifest-path: flatpak/hu.kramo.Cartridges.Devel.json windows: - name: Build for Windows + name: Windows runs-on: windows-latest steps: - name: Checkout From 3d6601238d22b6cb9756a34f1e4655e2562e55b7 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 12:21:55 +0200 Subject: [PATCH 06/13] Actions Test --- .github/workflows/ci.yml | 4 ++++ src/main.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26ab88e..a7db314 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,10 @@ jobs: pacman --noconfirm -Rs mingw-w64-ucrt-x86_64-desktop-file-utils mingw-w64-ucrt-x86_64-meson git find /ucrt64/share/locale/ -type f ! -name "*cartridges.mo" -delete + - name: Test + shell: msys2 {0} + run: timeout 2 cartridges + - name: "Inno Setup" run: iscc ".\_build\Cartridges.iss" diff --git a/src/main.py b/src/main.py index d0afd3e..203ba7a 100644 --- a/src/main.py +++ b/src/main.py @@ -21,6 +21,8 @@ import json import lzma import sys +import non_existent_module + import gi gi.require_version("Gtk", "4.0") From d87048ee64586da03cdc6f1bf9ec9c1e2705216b Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 12:26:56 +0200 Subject: [PATCH 07/13] Test worked --- .github/workflows/ci.yml | 6 +++--- src/main.py | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7db314..3faf70e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ concurrency: group: release-${{ github.sha }} jobs: flatpak: - name: "Flatpak" + name: Flatpak runs-on: ubuntu-latest container: image: bilelmoussaoui/flatpak-github-actions:gnome-44 @@ -48,10 +48,10 @@ jobs: shell: msys2 {0} run: timeout 2 cartridges - - name: "Inno Setup" + - name: Inno Setup run: iscc ".\_build\Cartridges.iss" - - name: "Upload Artifact" + - name: Upload Artifact uses: actions/upload-artifact@v3 with: name: Windows Installer diff --git a/src/main.py b/src/main.py index 203ba7a..d0afd3e 100644 --- a/src/main.py +++ b/src/main.py @@ -21,8 +21,6 @@ import json import lzma import sys -import non_existent_module - import gi gi.require_version("Gtk", "4.0") From 8a3397bef5b0a2016ee5523f5288071ab7175173 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 12:54:49 +0200 Subject: [PATCH 08/13] This should work --- .github/workflows/ci.yml | 2 +- src/main.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3faf70e..7f4d654 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: - name: Test shell: msys2 {0} - run: timeout 2 cartridges + run: timeout 2 cartridges; [ "$?" -eq "124" ] && true - name: Inno Setup run: iscc ".\_build\Cartridges.iss" diff --git a/src/main.py b/src/main.py index d0afd3e..203ba7a 100644 --- a/src/main.py +++ b/src/main.py @@ -21,6 +21,8 @@ import json import lzma import sys +import non_existent_module + import gi gi.require_version("Gtk", "4.0") From 69fc7e1b039360a31d54aa4a90a97b654192cc89 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 12:55:19 +0200 Subject: [PATCH 09/13] Remove test module --- src/main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.py b/src/main.py index 203ba7a..d0afd3e 100644 --- a/src/main.py +++ b/src/main.py @@ -21,8 +21,6 @@ import json import lzma import sys -import non_existent_module - import gi gi.require_version("Gtk", "4.0") From 1498326f45eca60e9659f598bfda4a29b72039a6 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 13:03:34 +0200 Subject: [PATCH 10/13] Exit differently --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f4d654..0988271 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: - name: Test shell: msys2 {0} - run: timeout 2 cartridges; [ "$?" -eq "124" ] && true + run: timeout 2 cartridges; [ "$?" -eq "124" ] && exit 0 - name: Inno Setup run: iscc ".\_build\Cartridges.iss" From ee5740c21c67520de0ab82ac198a21ccb05a7c50 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 14:46:37 +0200 Subject: [PATCH 11/13] Test Actions --- .github/workflows/ci.yml | 4 +++- src/main.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0988271..c7eca48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,9 @@ jobs: - name: Test shell: msys2 {0} - run: timeout 2 cartridges; [ "$?" -eq "124" ] && exit 0 + run: | + set +e + timeout 2 cartridges; [ "$?" -eq "124" ] - name: Inno Setup run: iscc ".\_build\Cartridges.iss" diff --git a/src/main.py b/src/main.py index d0afd3e..1b18823 100644 --- a/src/main.py +++ b/src/main.py @@ -23,6 +23,8 @@ import sys import gi +import non_existent_module + gi.require_version("Gtk", "4.0") gi.require_version("Adw", "1") From c9a1104b445161bab21388200e1ec7fc0cc7cdc4 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sun, 2 Jul 2023 14:46:54 +0200 Subject: [PATCH 12/13] Revert test --- src/main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.py b/src/main.py index 1b18823..d0afd3e 100644 --- a/src/main.py +++ b/src/main.py @@ -23,8 +23,6 @@ import sys import gi -import non_existent_module - gi.require_version("Gtk", "4.0") gi.require_version("Adw", "1") From e320e58ffcd78ba6de01406e2cd72f37b0afb065 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:43:33 +0200 Subject: [PATCH 13/13] Fix Appstream ID --- data/hu.kramo.Cartridges.metainfo.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/hu.kramo.Cartridges.metainfo.xml.in b/data/hu.kramo.Cartridges.metainfo.xml.in index 2828729..c6b57d4 100644 --- a/data/hu.kramo.Cartridges.metainfo.xml.in +++ b/data/hu.kramo.Cartridges.metainfo.xml.in @@ -1,6 +1,6 @@ - @APP_ID@.desktop + @APP_ID@ CC0-1.0 GPL-3.0-or-later Cartridges