From 3afc27efc98b3628c2a328942865322419406d0f Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Tue, 30 Nov 2021 16:28:29 +0200 Subject: [PATCH 1/3] A snapcraft recipe. Forced to add version and description because parse-info didn't work. --- packages/snap/snapcraft.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 packages/snap/snapcraft.yaml diff --git a/packages/snap/snapcraft.yaml b/packages/snap/snapcraft.yaml new file mode 100644 index 00000000..667d6dc6 --- /dev/null +++ b/packages/snap/snapcraft.yaml @@ -0,0 +1,36 @@ +name: pybitmessage +version: '0.6.3' +base: core18 +grade: devel +confinement: strict +summary: Reference client for Bitmessage, a P2P communications protocol +description: The PyBitmessage +adopt-info: pybitmessage + +apps: + pybitmessage: + command: pybitmessage + plugs: [network, network-bind, home, desktop, desktop-legacy, wayland, unity7] + desktop: share/applications/pybitmessage.desktop + environment: + LANG: C.UTF-8 + +parts: + pybitmessage: + source: https://github.com/g1itch/PyBitmessage.git + source-branch: snap + plugin: python + python-version: python2 + build-packages: + - libssl-dev + - python-all-dev + python-packages: + - defusedxml + - jsonrpclib + - qrcode + - stem + stage-packages: + - python-qt4 + - python-sip + - sni-qt + parse-info: [setup.py] -- 2.45.1 From c9ec2f63b5cb0122e9544f485a60a4cbb12209bc Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 1 Dec 2021 16:14:29 +0200 Subject: [PATCH 2/3] Try moving the import from src under the script condition --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f43f3d58..73c11e10 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,6 @@ from importlib import import_module from setuptools import setup, Extension from setuptools.command.install import install -from src.version import softwareVersion - EXTRAS_REQUIRE = { 'docs': ['sphinx', 'sphinx_rtd_theme'], @@ -49,6 +47,8 @@ class InstallCmd(install): if __name__ == "__main__": + from src.version import softwareVersion + here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() -- 2.45.1 From b518c200b0073904730dc91fe9f582103b268437 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 1 Dec 2021 18:41:22 +0200 Subject: [PATCH 3/3] Add a simple workflow --- .github/workflows/snap.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/snap.yml diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml new file mode 100644 index 00000000..59e00408 --- /dev/null +++ b/.github/workflows/snap.yml @@ -0,0 +1,53 @@ +name: Build snap + +on: + push: + pull_request: + branches: 'v0.6' + +jobs: + build-snap: + + runs-on: ubuntu-18.04 + + steps: + - name: Remove prev tag + if: ${{ github.ref == 'refs/heads/ci' }} + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + try { + await github.git.deleteRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: "tags/continuous" + }) + } catch (e) { + console.log("The continuous doesn't exist yet: " + e) + } + - uses: actions/checkout@v2 + - name: Install apt dependencies + run: | + sudo apt-get install -yq --no-install-suggests --no-install-recommends \ + snapcraft + - name: Build snap + id: snap + run: | + pushd packages; snapcraft; popd + echo "::set-output name=asset_path::packages/*.snap" + - uses: actions/upload-artifact@v2 + with: + name: snap + path: ${{ steps.snap.outputs.asset_path }} + - name: Release Continuous + if: ${{ github.ref == 'refs/heads/ci' }} + uses: softprops/action-gh-release@master + with: + prerelease: true + tag_name: continuous + target_commitish: ${{ github.sha }} + files: | + ${{ steps.snap.outputs.asset_path }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- 2.45.1