How to swap charm local -> charmhub

I’m trying to swap out a charm from a local deploy to a charmhub deploy…. Can’t figure out the syntax for it.

$ juju upgrade-charm gitlab-runner --switch ch:gitlab-runner --channel stable

ERROR revision-not-found: No revision was found in the Store.

$ juju version

2.9.16-ubuntu-amd64

Clearly there is a charm gitlab-runner: Deploy gitlab-runner using Charmhub - The Open Operator Collection

… Anyone knows how to do this?

I’m unable to reproduce, I wonder what the difference is? upgrade-charm is now an alias of refresh.

$ juju deploy ./charms/builds/ubuntu
Located local charm "ubuntu", revision 0
Deploying "ubuntu" from local charm "ubuntu", revision 0
$ juju refresh ubuntu --switch ch:ubuntu --channel stable
Added charm-hub charm "ubuntu", revision 19 in channel stable, to the model
$ juju status
Model  Controller  Cloud/Region         Version  SLA          Timestamp
seven  repro       localhost/localhost  2.9.16   unsupported  15:02:01Z

App     Version  Status  Scale  Charm   Store     Channel  Rev  OS      Message
ubuntu  20.04    active      1  ubuntu  charmhub  stable    19  ubuntu

Unit       Workload  Agent  Machine  Public address  Ports  Message
ubuntu/0*  active    idle   0        10.74.147.85

Machine  State    DNS           Inst id        Series  AZ  Message
0        started  10.74.147.85  juju-243710-0  focal       Running

Investigating further.

Tried with the gitlab-runner charm.

~$ juju refresh gitlab-runner --switch ch:gitlab-runner --channel stable
Added charm-hub charm "gitlab-runner", revision 4 in channel stable, to the model
Leaving endpoint in "alpha": scrape

@erik-lonroth, how did you install the local charm? By directory, or by tarball? Trying to find the difference in what we are doing.