Skip to content

Commit

Permalink
Add snapcraft workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
WaybackBot committed Aug 21, 2020
1 parent ed4a130 commit 11af20f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Snapcraft Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
snapcraft-release:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Snapcraft
run: |
sudo snap install snapcraft --classic
sudo snap install lxd
sudo usermod --append --groups lxd $USER
echo "::add-path::/snap/bin"
sudo chown root:root /
sudo /snap/bin/lxd.migrate -yes
sudo /snap/bin/lxd waitready
sudo /snap/bin/lxd init --auto
# You can now run Snapcraft shell commands
- name: Use Snapcraft
run: snapcraft --help

- name: Login snapcraft
run: |
LOGIN_FILEPATH=/tmp/credential
echo "${{ secrets.SNAPCRAFT_TOKEN }}" > $LOGIN_FILEPATH
snapcraft login --with $LOGIN_FILEPATH
- name: Build snap
run: sg lxd -c 'snapcraft --use-lxd'

- name: Publish snap
run: |
snapcraft push wayback_0+git.$(git rev-parse --short HEAD)_amd64.snap --release=stable,edge
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
$ go get -u github.com/wabarc/wayback/cmd/wayback
```

Using [Snapcraft](https://snapcraft.io/wayback) (on GNU/Linux)

```sh
$ sudo snap install wayback
```

## Usage

- Running as CLI command or Docker container
Expand Down
25 changes: 25 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: wayback

version: 'git'

summary: A toolkit to upload files to IPFS pinning services.

description: |
A toolkit for snapshot webpage to the Wayback Machine.
Website https://github.com/wabarc/wayback
grade: stable

confinement: strict

base: core18

parts:
wayback:
plugin: go
source: https://github.com/wabarc/wayback.git
go-importpath: github.com/wabarc/wayback/cmd/wayback

apps:
wayback:
command: wayback

0 comments on commit 11af20f

Please sign in to comment.