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

build: package ignite for flatpak and snap #3786

Merged
merged 18 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 12 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
6 changes: 3 additions & 3 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release Binaries

on:
release:
types: [ published ]
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest
env:
working-directory: go/src/github.com/ignite/cli

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"

- name: Checkout
uses: actions/checkout@v3
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish snap package

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
publish-snap:
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build snap package
uses: snapcore/action-build@v1
id: build-snap

- name: Publish snap package
uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.SNAPCRAFT_LOGIN }}
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
snap: ${{ steps.build-snap.outputs.snap }}
release: stable
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- [#3786](https://github.com/ignite/cli/pull/3786) Add artifacts for publishing Ignite to FlatHub and Snapcraft

## [`v28.0.0`](https://github.com/ignite/cli/releases/tag/v28.0.0)

### Features
Expand All @@ -17,6 +21,7 @@
- [#3626](https://github.com/ignite/cli/pull/3626) Add logging levels to relayer
- [#3614](https://github.com/ignite/cli/pull/3614) feat: use DefaultBaseappOptions for app.New method
- [#3715](https://github.com/ignite/cli/pull/3715) Add test suite for the cli tests
- [#3756](https://github.com/ignite/cli/pull/3756) Add faucet compatibility for latest sdk chains

### Changes

Expand Down
4 changes: 4 additions & 0 deletions packaging/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.flatpak-builder
build-dir
repo
*.snap
45 changes: 45 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Packaging and Distributing Ignite

Ignite CLI is distributed on multiple platforms and package managers. This document describes how to package and distribute Ignite CLI.

## Flatpak

Read the folowing resources to understand Flatpak.

* <https://docs.flathub.org/docs/for-app-authors>
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
* <https://docs.flatpak.org/en/latest/first-build.html>

```bash
cd packaging/flatpak
sudo apt install flatpak-builder
flatpak install org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 org.freedesktop.Sdk.Extension.golang//23.08
flatpak-builder build-dir com.ignite.Ignite.yml --force-clean
flatpak-builder --user --install--force-clean --repo=repo build-dir com.ignite.Ignite.yml
flatpak run com.ignite.Ignite
```

The Flatpak is published at <https://flathub.org/apps/com.ignite.Ignite>.
The update process is done manually at <https://github.com/flathub/com.ignite.Ignite> at the moment. At each release, edit `com.ignite.Ignite.yml` and the metainfo file to update the version.

## Snap

Read the folowing resources to understand Snap.

* <https://snapcraft.io/docs/snapcraft-overview>
* <https://snapcraft.io/docs/go-plugin#heading--core22>
* <https://snapcraft.io/docs/go-applications>

```bash
cd packaging/snap
sudo apt install snapd
sudo snap install multipass
multipass launch
SNAPCRAFT_BUILD_ENVIRONMENT=multipass snapcraft
snap install ignite_0.0.0_amd64.snap --dangerous --classic
```

A [github action](../.github/workflows/release-binary.yml) is used to build and publish the Snap at each released.

## HomeBrew

TBD.
33 changes: 33 additions & 0 deletions packaging/flatpak/com.ignite.Ignite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
app-id: com.ignite.Ignite
runtime: org.freedesktop.Platform
runtime-version: "23.08"
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.golang
command: ignite

finish-args:
- --share=network
- --device=all
- --filesystem=host
build-options:
append-path: /usr/lib/sdk/golang/bin
build-args:
- --share=network
env:
- GOBIN=/app/bin
- GOROOT=/usr/lib/sdk/golang

modules:
- name: ignite
buildsystem: simple
build-commands:
- $GOROOT/bin/go build -mod=readonly -o ignt ./ignite/cmd/ignite
- install -Dm00755 ignt $FLATPAK_DEST/bin/ignite
#- install -Dm00644 packaging/flatpak/logo.svg $FLATPAK_DEST/share/icons/hicolor/scalable/apps/ignite.svg
#- install -Dm00644 packaging/flatpak/ignite.desktop $FLATPAK_DEST/share/applications/ignite.desktop
#- install -Dm00644 packaging/flatpak/ignite.metainfo.xml $FLATPAK_DEST/share/metainfo/ignite.metainfo.xml
sources:
- type: git
url: "https://github.com/ignite/cli.git"
tag: "v28.0.0"
10 changes: 10 additions & 0 deletions packaging/flatpak/ignite.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application

Name=ignite
Comment=Ignite CLI is the all-in-one platform to build, launch, and maintain any crypto application on a sovereign and secured blockchain
Categories=Utility;Development;Network

Icon=ignite
Exec=ignite
Terminal=true
61 changes: 61 additions & 0 deletions packaging/flatpak/ignite.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.ignite.Ignite</id>

<name>Ignite CLI</name>
<developer_name>Ignite</developer_name>

<summary>Ignite CLI is the all-in-one platform to build, launch, and maintain any crypto
application on a sovereign and secured blockchain.</summary>

<categories>
<category>Development</category>
</categories>

<metadata_license>Apache</metadata_license>
<project_license>Apache</project_license>

<keywords>
<keyword>ignite</keyword>
<keyword>cosmos</keyword>
<keyword>cosmos-sdk</keyword>
<keyword>blockchain</keyword>
<keyword>development</keyword>
<keyword>tendermint</keyword>
</keywords>

<recommends>
<control>keyboard</control>
</recommends>

<description>
<p>Ignite CLI offers everything you need to build, test, and launch your blockchain with a
decentralized worldwide community.</p>
<p>Ignite CLI is built on top of Cosmos SDK, the world's most popular blockchain framework.</p>
<p>Ignite CLI accelerates chain development by scaffolding everything you need so you can focus
on business logic.</p>
</description>

<launchable type="desktop-id">ignite.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/ignite/cli/v0.27.1/assets/ignite-cli.png</image>
<caption>How it works</caption>
</screenshot>
</screenshots>

<url type="bugtracker">https://github.com/ignite/cli/issues</url>
<url type="homepage">https://github.com/ignite/cli</url>

<content_rating type="oars-1.1" />

<releases>
<release version="28.0.0" date="2023-12-05" type="stable">
<description>
<p>Ignite CLI v28.0.0 adds support for Cosmos SDK Eden (v0.50)</p>
</description>
<url type="details">https://github.com/ignite/cli/releases/tag/v28.0.0</url>
</release>
</releases>
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved

</component>
15 changes: 15 additions & 0 deletions packaging/flatpak/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions packaging/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: ignite
base: core22 # the base snap is the execution environment for this snap
version: "28.0.0"
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
summary: Build, launch, and maintain any crypto application with Ignite CLI # 79 char long summary
description: |
Ignite CLI offers everything you need to build, test, and launch your blockchain with a decentralized worldwide community. Ignite CLI is built on top of Cosmos SDK, the world's most popular blockchain framework.
Ignite CLI accelerates chain development by scaffolding everything you need so you can focus on business logic.

grade: stable # must be 'stable' to release into candidate/stable channels
confinement: classic

parts:
ignite:
plugin: go
source: https://github.com/ignite/cli.git
source-tag: v28.0.0
source-subdir: ignite/cmd/ignite
build-snaps:
- go

apps:
ignite:
command: bin/ignite
plugs: [home, network, network-bind, removable-media]