-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
800 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
## Build and Publish Snap Package workflow | ||
|
||
This workflow builds a `snap` package and uploads it to the [Snap Store](https://snapcraft.io/store). It has a `workflow_dispatch` trigger so it can be triggered manually only, it is not hooked up to any other GH event. | ||
|
||
The store upload requires the `SNAPCRAFT_STORE_CREDENTIALS` variable to be set in [Github Secrets](https://github.com/decred/dcrdex/settings/secrets/actions). | ||
See https://github.com/snapcore/action-publish for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build and Publish Snap Package | ||
|
||
on: | ||
# manually trigger the workflow from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-snap: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Compile frontend | ||
working-directory: client/webserver/site | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Install deb deps | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install libgtk-3-dev libwebkit2gtk-4.0-dev build-essential | ||
- name: Build deb package | ||
working-directory: client/cmd/dexc-desktop | ||
run: pkg/pkg-debian.sh | ||
|
||
- name: Prepare snapcraft.yml | ||
working-directory: client/cmd/dexc-desktop | ||
run: pkg/prepare-snap.sh | ||
|
||
- name: Build snap package | ||
uses: snapcore/action-build@2ee46bc29d163c9c836f2820cc46b39664bf0de2 # v1.1.3 | ||
id: build | ||
with: | ||
path: client/cmd/dexc-desktop | ||
|
||
- name: Publish snap to Snap Store | ||
uses: snapcore/action-publish@0a8d537ae06f4a292e8b4ef1084cd5631b3c6871 # v1.1.1 | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | ||
with: | ||
snap: ${{ steps.build.outputs.snap }} | ||
release: stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,53 @@ | ||
# Build Instructions for dexc-desktop | ||
# Build Instructions for bisonw-desktop | ||
|
||
The dexc-desktop client is a cross-platform desktop application for the DEX client and wallet. The instructions below are for building the client from source. If you are looking for pre-built binaries, see the [releases page](https://github.com/decred/dcrdex/releases). | ||
The bisonw-desktop client is a cross-platform desktop application for the DEX client and wallet. The instructions below are for building the client from source. If you are looking for pre-built binaries, see the [releases page](https://github.com/decred/dcrdex/releases). | ||
|
||
**Note**: The instructions below are to be run in your CLI from the `dexc-desktop` directory. | ||
**Note**: The instructions below are to be run in your CLI from the `client/cmd/bisonw-desktop` directory. | ||
|
||
## Debian | ||
Build with `./pkg/pkg-debian.sh`. The deb archive is located in **./build**. | ||
Build with `./pkg/pkg-debian.sh`. The deb archive will be located in **./build**. | ||
|
||
For development, you'll need to install the WebKit Development Libraries and the standard build toolchain: | ||
|
||
```bash | ||
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev build-essential | ||
``` | ||
For production, they are specified as DEPENDS in the control file and the package manager will install them. | ||
|
||
## Snap | ||
|
||
Snap is a package standard that can be installed on many Linux distributions from the Snap Store, and via software centers in e.g. Fedora, Ubuntu. | ||
|
||
### Preparing the build environment | ||
```bash | ||
# on Ubuntu 22.04 LTS: | ||
sudo apt-get install snap | ||
# on Debian: | ||
sudo apt-get install snapd | ||
|
||
sudo snap install --classic snapcraft | ||
sudo adduser $USER lxd | ||
newgrp lxd | ||
lxd init --auto | ||
sudo ufw disable # if ufw is installed on the host, this is neccessary for lxd to have network access | ||
|
||
``` | ||
|
||
### Running the build | ||
|
||
1. Build the Debian package | ||
2. `./pkg/pkg-snap.sh` | ||
|
||
### Installing the .snap file locally | ||
|
||
`sudo snap install --dangerous build/bisonwallet*.snap` | ||
|
||
### Publishing the snap | ||
|
||
The snap can be uploaded to the Snap Store using `./pkg/publish-snap.sh`. This requires [Snapcraft developer account credentials](https://snapcraft.io/docs/releasing-your-app). After this is completed, the package can be installed on any system running `snap` by running `snap install bisonw`. The app will be available on the [Snap Store](https://snapcraft.io/store/bisonw). | ||
|
||
|
||
|
||
For development, you'll need to install the WebKit Development Libraries. | ||
`apt install libgtk-3-dev libwebkit2gtk-4.0-dev` | ||
For production, they are specified as DEPENDS in the control file and the | ||
package manager will install them. | ||
|
||
## MacOS (darwin) | ||
Build with `./pkg/pkg-darwin.sh` for `amd64` MacOS machines. If running on an | ||
`arm64` machine, you'll need to build with `TARGETS=darwin/arm64 ./pkg/pkg-darwin.sh` instead. | ||
The `.dmg` click installer can be located in **./pkg/installers** after a successful build. | ||
Build with `./pkg/pkg-darwin.sh` for `amd64` MacOS machines. If running on an `arm64` machine, you'll need to build with `TARGETS=darwin/arm64 ./pkg/pkg-darwin.sh` instead. The `.dmg` click installer can be located in **./pkg/installers** after a successful build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
# This file defines common variables to be source'd by the various build scripts | ||
# in this directory. | ||
|
||
# pick up the release tag from git | ||
VER=$(git describe --tags --abbrev=0 --always | sed -e 's/^v//') | ||
META= # "release" | ||
REV="0" | ||
|
||
APP="bisonw" | ||
ARCH="amd64" | ||
|
||
# The build directory will be deleted at the beginning of every build. The | ||
# directory is .gitignore'd. | ||
BUILD_DIR="./build" | ||
|
||
# DEB_NAME follows the prescribed format for debian packaging. | ||
DEB_NAME="${APP}_${VER}-${REV}_${ARCH}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
|
||
source $SCRIPT_DIR/common.sh | ||
|
||
SNAPCRAFT_YML_IN=snap/local/snapcraft.yaml.in | ||
SNAPCRAFT_YML=snap/snapcraft.yaml | ||
sed -e "s/\$VERSION/$VER/g" \ | ||
-e "s/\$DEB_NAME/$DEB_NAME/g" "$SNAPCRAFT_YML_IN" > "$SNAPCRAFT_YML" | ||
|
||
snapcraft --verbose --output $BUILD_DIR/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
source $(dirname "$0")/common.sh | ||
|
||
snapcraft login | ||
|
||
snapcraft upload --release=stable $BUILD_DIR/${APP}_${VER}_${ARCH}.snap |
Oops, something went wrong.