From 0be502e1c20ae77a84d90fba7320211302b46db9 Mon Sep 17 00:00:00 2001 From: Paul Larson Date: Tue, 14 Nov 2023 11:16:46 -0600 Subject: [PATCH] Build cli snap workflow (#151) * Add a github workflow to publish the cli snap * Update the README.rst with more information about snap publication * Also enable manual triggering of snap and server charm builds --- .github/workflows/cli-publish-snap.yml | 23 +++++++++++++++++++ .../workflows/server-charm-release-edge.yml | 1 + cli/README.rst | 16 +++++++++---- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/cli-publish-snap.yml diff --git a/.github/workflows/cli-publish-snap.yml b/.github/workflows/cli-publish-snap.yml new file mode 100644 index 00000000..43dc84e3 --- /dev/null +++ b/.github/workflows/cli-publish-snap.yml @@ -0,0 +1,23 @@ +name: Publish Testflinger CLI snap to edge +on: + push: + branches: ["main"] + paths: + - cli/** + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: snapcore/action-build@v1 + id: build + with: + path: cli + - uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }} + with: + snap: ${{ steps.build.outputs.snap }} + release: edge diff --git a/.github/workflows/server-charm-release-edge.yml b/.github/workflows/server-charm-release-edge.yml index 443f2f39..0e2ac028 100644 --- a/.github/workflows/server-charm-release-edge.yml +++ b/.github/workflows/server-charm-release-edge.yml @@ -6,6 +6,7 @@ on: - main paths: - server/** + workflow_dispatch: jobs: build: diff --git a/cli/README.rst b/cli/README.rst index 520cd4f9..5f8d0304 100644 --- a/cli/README.rst +++ b/cli/README.rst @@ -12,11 +12,19 @@ the status of them, and getting results. Installation ------------ -You can either run testflinger-cli from a checkout of the code, or -install it like any other python project. +It is recommended that you install testflinger-cli from the snap, however it +can also be installed with pip directly from the source. -To run it from a checkout, please make sure to first install python3-click -and python3-requests +To install testflinger using the snap: + +.. code-block:: console + + $ sudo snap install testflinger-cli + +When changes are made to the CLI, the snap is automatically built and uploaded +to the `edge` channel. Once sufficient testing has been performed, this snap +is also published to the `stable` channel. If you prefer to use the latest +code, then you can specify `edge` instead in the command above. To install it in a virtual environment: