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

Add new "modern" elementaryOS template #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
16 changes: 16 additions & 0 deletions templates/elementaryos/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig <https://EditorConfig.org>
root = true

# elementary defaults
[*]
charset = utf-8
end_of_line = lf
indent_size = tab
indent_style = space
insert_final_newline = true
max_line_length = 80
tab_width = 4

# Markup files
[{*.html,*.xml,*.xml.in,*.yml}]
tab_width = 2
49 changes: 49 additions & 0 deletions templates/elementaryos/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [ main ]

pull_request:
branches: [ main ]
types:
- opened
- reopened
- synchronize

jobs:
flatpak:
name: Flatpak
runs-on: ubuntu-latest

container:
image: ghcr.io/elementary/flatpak-platform/runtime:daily
options: --privileged

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: ${PROGRAM_NAME}.flatpak
manifest-path: com.github.${USERNAME}.${PROGRAM_NAME}.yml
run-tests: true
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
cache-key: "flatpak-builder-${{ github.sha }}"

lint:
name: Lint
runs-on: ubuntu-latest

container:
image: valalang/lint

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Lint
run: io.elementary.vala-lint -d .
23 changes: 23 additions & 0 deletions templates/elementaryos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ${PROJECT_NAME}

${PROJECT_SUMMARY}

## Building, Testing, and Installation

You'll need the following dependencies to build:
* libgtk-4-dev
* libgranite-7-dev
* meson
* valac

Run `meson build` to configure the build environment and run `ninja` to build
```Bash
meson build --prefix=/usr
cd build
ninja
```
To install, use `ninja install`, then execute with `com.${USERNAME}.${PROGRAM_NAME}`
```Bash
sudo ninja install
com.github.${USERNAME}.${PROGRAM_NAME}
```
34 changes: 34 additions & 0 deletions templates/elementaryos/com.github.${USERNAME}.${PROGRAM_NAME}.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is the same ID that you've used in meson.build and other files
app-id: com.github.${USERNAME}.${PROGRAM_NAME}

# Instead of manually specifying a long list of build and runtime dependencies,
# we can use a convenient pre-made runtime and SDK. For this example, we'll be
# using the runtime and SDK provided by elementary.
runtime: io.elementary.Platform
runtime-version: "8"
sdk: io.elementary.Sdk

# This should match the exec line in your .desktop file and usually is the same
# as your app ID
command: com.github.${USERNAME}.${PROGRAM_NAME}

# Here we can specify the kinds of permissions our app needs to run. Since we're
# not using hardware like webcams, making sound, or reading external files, we
# only need permission to draw our app on screen using either X11 or Wayland.
finish-args:
- "--share=ipc"
- "--socket=fallback-x11"
- "--socket=wayland"

# Needed to read prefers-color-scheme with Granite.Settings
- "--system-talk-name=org.freedesktop.Accounts"

# This section is where you list all the source code required to build your app.
# If we had external dependencies that weren't included in our SDK, we would list
# them here.
modules:
- name: ${PROGRAM_NAME}
buildsystem: meson
sources:
- type: dir
path: .
Loading