Skip to content

Merge pull request #24 from canonical/upgrade-version-3.1.3 #15

Merge pull request #24 from canonical/upgrade-version-3.1.3

Merge pull request #24 from canonical/upgrade-version-3.1.3 #15

Workflow file for this run

name: Publish ROCK
on:
push:
branches:
- main
jobs:
build:
uses: ./.github/workflows/build.yaml
publish:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Docker
run: |
sudo snap install docker
sudo addgroup --system docker; sudo adduser $USER docker
newgrp docker
sudo snap disable docker; sudo snap enable docker
- name: Install skopeo
run: |
sudo snap install --devmode --channel edge skopeo
- name: Install yq
run: |
sudo snap install yq
- uses: actions/download-artifact@v3
with:
name: charmed-superset-rock
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Import and push to GHCR
run: |
app_version=$(yq '.version' rockcraft.yaml)
version=$(yq '(.version|split("-"))[0]' rockcraft.yaml)
base=$(yq '(.base|split("@"))[1]' rockcraft.yaml)
risk=edge
tag=${version}-${base}-${risk}
sudo skopeo --insecure-policy copy \
oci-archive:charmed-superset-rock_${tag}_amd64.rock \
docker-daemon:ghcr.io/canonical/charmed-superset-rock:${tag}
docker push ghcr.io/canonical/charmed-superset-rock:${tag}