Skip to content

Commit

Permalink
Add build rock and charm steps to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmartinspt committed Dec 14, 2023
1 parent 6f1d5ef commit f1dcbb1
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,71 @@ env:
SECRET_KEY: insecure_test_key

jobs:
build-and-publish-image:
name: Build and Publish Image
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3

- name: Build Assets
run: |
yarn install
yarn run build-css
yarn run build-js
- name: Install Rockcraft
run: sudo snap refresh rockcraft --classic --channel=edge/12f

- name: Install Charmcraft
run: sudo snap refresh charmcraft --classic --channel=edge/12f

- name: Build Rock Image
run: |
export ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true
rockcraft pack
- name: Publish Rock Image
run: >-
skopeo --insecure-policy copy
oci-archive:$(ls *.rock)
docker://ghcr.io/canonical/dqlite.io:$(git rev-parse --short HEAD)
--dest-creds "canonical:${{ secrets.GITHUB_TOKEN }}"
build-and-publish-charm:
name: Build Charm
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3

- name: Build Assets
run: |
yarn install
yarn run build-css
yarn run build-js
- name: Install Charmcraft
run: sudo snap refresh charmcraft --classic --channel=edge/12f

- name: Build charm
run: cd charm/ && charmcraft pack

- name: Upload charm artifact
steps:
- uses: actions/upload-artifact@v4
with:
name: charm-${git rev-parse --short HEAD}.charm
path: ./*.charm

run-dotrun:
runs-on: ubuntu-latest

Expand Down

0 comments on commit f1dcbb1

Please sign in to comment.