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 snapcraft #6388

Merged
merged 12 commits into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from 10 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
54 changes: 54 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,34 @@ jobs:
name: Publish release
command: ./scripts/publish-release.sh

publish-snapcraft:
description: build and push snapcraft
machine:
image: ubuntu-2004:202104-01
resource_class: 2xlarge
parameters:
channel:
type: string
default: "edge"
description: snapcraft channel
steps:
- checkout
- run:
name: install snapcraft
command: sudo snap install snapcraft --classic
- run:
name: create snapcraft config file
command: |
mkdir -p ~/.config/snapcraft
echo "$SNAPCRAFT_LOGIN_FILE" | base64 -d > ~/.config/snapcraft/snapcraft.cfg
- run:
name: build snap
command: snapcraft --use-lxd
- run:
name: publish snap
command: snapcraft push *.snap --release << parameters.channel >>


build-and-push-image:
description: build and push docker images to public AWS ECR registry
executor: aws-cli/default
Expand Down Expand Up @@ -861,3 +889,29 @@ workflows:
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish-snapcraft:
name: publish-snapcraft-stable
channel: stable
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
- publish-snapcraft:
name: publish-snapcraft-tmp
channel: edge
coryschwartz marked this conversation as resolved.
Show resolved Hide resolved

nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- publish-snapcraft:
name: publish-snapcraft-nightly
channel: edge
1 change: 1 addition & 0 deletions snap/local/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 61 additions & 14 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,75 @@
name: lotus
base: core18
version: '1.8.0'
name: lotus-filecoin
base: core20
version: latest
summary: filecoin daemon/client
icon: snap/local/icon.svg
description: |
Filecoin is a peer-to-peer network that stores files on the internet
with built-in economic incentives to ensure files are stored reliably over time

For documentation and additional information, please see the following resources

https://filecoin.io

https://fil.org

https://docs.filecoin.io

https://github.com/filecoin-project/lotus

grade: devel
confinement: devmode # use 'strict' once you have the right plugs and slots
confinement: strict

parts:
libs:
plugin: dump
lotus:
plugin: make
source: ./
organize:
'lotus' : bin/
'lotus-*' : bin/
build-snaps:
- go
- rustup
build-packages:
- git
- jq
- libhwloc-dev
- ocl-icd-opencl-dev
- pkg-config
stage-packages:
- libhwloc15
- ocl-icd-libopencl1
- libhwloc1
- libgcc1
override-build: |
LDFLAGS="" make lotus lotus-miner lotus-worker
cp lotus lotus-miner lotus-worker $SNAPCRAFT_PART_INSTALL

apps:
lotus:
command: bin/lotus
command: lotus
plugs:
- network
- network-bind
environment:
FIL_PROOFS_PARAMETER_CACHE: $SNAP_USER_COMMON/filecoin-proof-parameters
LOTUS_PATH: $SNAP_USER_COMMON/lotus
LOTUS_MINER_PATH: $SNAP_USER_COMMON/lotus-miner
LOTUS_WORKER_PATH: $SNAP_USER_COMMON/lotus-worker
lotus-miner:
command: bin/lotus-miner
command: lotus-miner
plugs:
- network
- network-bind
- opengl
environment:
FIL_PROOFS_PARAMETER_CACHE: $SNAP_USER_COMMON/filecoin-proof-parameters
LOTUS_PATH: $SNAP_USER_COMMON/lotus
LOTUS_MINER_PATH: $SNAP_USER_COMMON/lotus-miner
LOTUS_WORKER_PATH: $SNAP_USER_COMMON/lotus-worker
lotus-worker:
command: bin/lotus-worker
command: lotus-worker
plugs:
- network
- network-bind
- opengl
environment:
FIL_PROOFS_PARAMETER_CACHE: $SNAP_USER_COMMON/filecoin-proof-parameters
LOTUS_PATH: $SNAP_USER_COMMON/lotus
LOTUS_MINER_PATH: $SNAP_USER_COMMON/lotus-miner
LOTUS_WORKER_PATH: $SNAP_USER_COMMON/lotus-worker