Skip to content

Commit

Permalink
ci/cd base (#1028)
Browse files Browse the repository at this point in the history
* ci/cd base

* snap release

* only on tags and release to 1/edge

---------

Signed-off-by: Mina Ashraf <[email protected]>
  • Loading branch information
mina1460 authored Aug 23, 2023
1 parent 57607e5 commit e853eda
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 5 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/snap-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release jimmctl snap

on:
workflow_dispatch:
push:
tags:
- 'v1*'


# 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
- name: scripts
run: |
mkdir -p ./snap
cp ./snaps/jimmctl/snapcraft.yaml ./snap/
- uses: snapcore/action-build@v1
id: snapcraft
- uses: actions/upload-artifact@v2
with:
name: ${{ 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}}
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{needs.build.outputs.snap}}
release: '1/edge'

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ local/vault/roleid.txt
*.crt
*.key
*.csr
jimmctl
/jimmctl
qa-controller
File renamed without changes.
11 changes: 7 additions & 4 deletions snaps/jaas/snapcraft.yaml → snaps/jimmctl/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: jaas
name: jimmctl
version: git
summary: JAAS client
description: Client for controlling JAAS multi-cloud juju controllers.
Expand All @@ -19,20 +19,23 @@ apps:
- dot-local-share-juju
- network


parts:
jimmctl:
plugin: go
source: ../..
source: ./
source-type: git
prime:
- bin/jimmctl
override-build: |
set -e
go install -mod readonly -p 16 -ldflags '-linkmode=external' github.com/canonical/jimm/cmd/jimmctl
go install -mod readonly -ldflags '-linkmode=external' github.com/canonical/jimm/cmd/jimmctl
files:
plugin: dump
source: files
source: snaps/jimmctl/files/
source-type: local
organize:
jimmctl.wrapper: bin/wrappers/jimmctl
prime:
Expand Down

0 comments on commit e853eda

Please sign in to comment.