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

ci/cd base #1028

Merged
merged 24 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
51 changes: 51 additions & 0 deletions .github/workflows/snap-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release to v1/edge

on:
workflow_dispatch:
inputs:
channel:
description: 'Release Channel'
required: true
type: choice
options:
- '1'
- '2'


# Note this workflow requires a Github secret to provide auth against snapstore.
# snapcraft export-login --snaps=PACKAGE_NAME --acls package_access,package_push,package_update,package_release exported.txt
# check this: https://github.com/snapcore/action-publish

jobs:
build:
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: snapcore/action-build@v1
id: snapcraft
with:
path: snaps/jimm/
- uses: actions/upload-artifact@v2
with:
name: manual-${{ steps.snapcraft.outputs.snap }}
path: ${{ steps.snapcraft.outputs.snap }}

publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: ${{needs.build.outputs.snap}}
mina1460 marked this conversation as resolved.
Show resolved Hide resolved
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{needs.build.outputs.snap}}
release: ${{ inputs.channel }}

2 changes: 1 addition & 1 deletion .github/workflows/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- run: sudo snap install snapcraft --channel=7.x/stable --classic
- run: mkdir -p snap
- run: cp ./snaps/jimm/snapcraft.yaml ./snap/snapcraft.yaml
- run: snapcraft snap --destructive-mode --output jimm.snap
- run: snapcraft snap --destructive-mode --output jimmctl.snap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a snap action... @kian99 you used it right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there's a snap action but I have used existing charm actions for releasing e.g. https://github.com/canonical/charming-actions we should look for existing Snap actions. I found https://github.com/snapcore/action-publish which I found via https://snapcraft.io/docs/ros-with-github-actions
There's also https://github.com/marketplace/actions/snapcraft-action

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kian99 @ale8k
I am using the ready-made actions in the release yaml. I edited the name here so that it is also updated to jimmctl.

Are you referring to something else other than the one I used for snap building and publishing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes I see that's the case in the release.yaml PR, I hadn't taken a look at that yet. This building one is fine, unless there is also a snapcore/build action you can use and clean up what already exists.

- uses: actions/upload-artifact@v3
with:
name: jimm-snap
Expand Down
2 changes: 1 addition & 1 deletion snaps/jimm/snapcraft.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct snapcraft.yaml to edit, this one is for the JIMM server, there will be another one where the name is JAAS that needs to be renamed to jimmctl

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: jimm
name: jimmctl
summary: Juju Intelligent Model Manager
description: Multi-cloud controller for managing JAAS models.
grade: stable
Expand Down
Loading