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/