Skip to content
Open
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
55 changes: 55 additions & 0 deletions native/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: itch-setup
summary: itch.io installer.
description:| An installer for the itch.io desktop app.

adopt-info: itch-setup

grade: stable
confinement: classic

architectures:
- build-on: i386
- build-on: amd64
- build-on: armhf
- build-on: arm64

apps:
itch-setup:
command: bin/itch-setup
plugs:
- home
- network
- docker
- removable-media

parts:
itch-setup:
plugin: nil
source: https://github.com/itchio/itch-setup.git
source-type: git
override-pull: |
git clone https://github.com/itchio/itch-setup.git src/github.com/itchio/itch-setup
cd src/github.com/itchio/itch-setup
last_committed_tag="$(git describe --tags --abbrev=0)"
last_committed_tag_ver="$(echo ${last_committed_tag} | sed 's/v//')"
last_released_tag="$(snap info $SNAPCRAFT_PROJECT_NAME | awk '$1 == "beta:" { print $2 }')"
# If the latest tag from the upstream project has not been released to
# beta, build that tag instead of master.
if [ "${last_committed_tag_ver}" != "${last_released_tag}" ]; then
git fetch
git checkout "${last_committed_tag}"
fi
snapcraftctl set-version "$(git describe --tags | sed 's/v//')"
override-build: |
export GOPATH=$PWD
cd src/github.com/itchio/itch-setup
env CGO_ENABLED=0 GOOS=linux \
go build --ldflags "-s -w \
-X 'github.com/itchio/itch-setup/version.GitCommit=$(git rev-list -1 HEAD)' \
-X 'github.com/itchio/itch-setup/version.Version=$(git describe --tags --abbrev=0)'" \
-a -installsuffix cgo -o $SNAPCRAFT_PART_INSTALL/bin/itch-setup
build-snaps:
- go
build-packages:
- git
- sed