Releasing a new version of Google add-on - google-apps-script

I am working on an add-on for the new Google spreadsheets but I wonder how versions are handled? In the old script gallery, there were versions. Are they working the same in add-ons after the add-on is published?
Also I see an auto generated Help submenu item. How do I generate content for it?
Thanks.
Thanks to #Steve Lieberman answer I see now how to choose on publish and update later the version of the add-on. But in the documentation I can't find an explanation of what will be the effect of updating to a new version on already used copies of the add-on. Will they be automatically updated? Will they receive in some form a notification of the new version?
Thanks.

When you publish your add-on [1], there's an option to select the version of the script that will be used.
Note there's also a version of the Chrome Web Store entry, this can differ from the version of the script.
The source code that is executed will be based on the version of the script that is published to the Chrome Web Store.
[1] https://developers.google.com/apps-script/add-ons/publish#publish_your_add-on

First create a new deployment/version of the script in the script editor.
Then update the script version in the Project's Google Workspace Marketplace SDK page, App Configuration tab (scroll down), then Save it.
Note that the update will take effect immediately when Saved, including for documents that are currently open in a browser.
Debugging: I don't think it's possible to have multiple deployments/versions of a Published Add-On active at the same. You have to do your debugging of the HEAD version in the Add-On's Host document, or in a document that does not have the Add-On installed (you can add the HEAD deployment of the Project as a script library in that case).

Related

Is there branching functionality on a Google Apps Script Project?

I am new to Google Apps Script projects, and have a Google Calendar add-on that I have been working on. My users recently came across some bugs, and I realized that I had no idea how to go back to the version they were on, and save the current updates I was working on at the same time, like a github branch.
I did some research and couldn't find anything out online, so just want to know if there are any other alternatives other than pulling down all code locally and uploading it to my personal GitHub.
To make your add-on go back to a previous version, just go to the Google Workspace Marketplace SDK and set the version number that you want to make available for your add-on users.
The Google Apps Script web editor it will always be showing the head deployment. You might use Google Apps Script API / CLASP to get access to any version. If you want to use the web editor, you should overwrite the files of with the version that you want to use.

How to edit an old version in Google Appsscripts

I was looking info related to deployment and edit of different versions in new Google AppsScript editor.
https://developers.google.com/apps-script/concepts/deployments#edit_a_versioned_deployment
I noticed that you can "edit and deploy" older versions but when I do that I noticed that the scripts doesn't change.
Before changes
After changes
Here I update the version.
Then I try to edit the old one.
But the script doesn't change, I mean, at this part I would expect to see what I wrote in the first image.
What am I doing wrong?
Editing a versioned deployment doesn't change the current script code. It just changes that deployment code, so you can use it as an add-on, a web app, or what have you, but it doesn't revert your current code to that version.
The old editor did have the functionality you are looking for (clicking File > See verstion history > Restore), but not the new one. There's a feature request in Issue Tracker to add this to the new editor, consider subscribing to it:
Restore an old version in Google Apps Script's new editor

Change project of a deployed script, and I couldn't unpublished the previous one

I have just updated an old Google Apps Script for Google Spreadsheet.
Due to new updates requirements I have been requested to create a new project in Google Cloud to be able to update it.
The problem appears when the old script (has >5.000 users) once I changed to a new one, the system didn't updated it at all and just create a new plugin. The update has been made in the same Script file, just changing the project. The old one was the default project which is now unavailable.
The worst part is that I don't know how to unpublish the old one as it has been deprecated the service it's using it.
Any idea how to solve this?
Replying as an answer for the new comment and the question itself:
To Upgrade your published add-on the instruction are explained on the link:
Upgrading your published add-ons
To unpublish an add-on the instructions are on the link:
Update or unpublish an app listing
To unpublish your app listing, follow these steps:
Open your app’s Cloud Platform project in the Google Cloud Platform >console.
At the top left, click Menu menu > APIs & Services.
In the list at the bottom, click Google Workspace Marketplace SDK.
At the left, click Store Listing.
Click Unpublish. To republish, follow the above steps and click Publish.
After you unpublish, your app listing no longer appears on Google Workspace Marketplace or the chatbot catalog, and users who have already installed your app can no longer access it. If you republish, the users who had previously installed your app regain access.

Trying to update Google Sheets Addon

I am trying to update a Google Sheets Addon.
I currently face 2 problems:
the new Script Editor does not know anything about versions (so I used the legacy editor and created a new version there)
when I want to deploy the changes (via the G Suite Marketplace SDK) I get an "Project Key is not associated with the current project or the script version doesn't exist." error when I enter the new version.
What should I do?
We have just rolled back to a previous version, can you refresh and try again? Please let me know how it goes.

Deploying my custom Google Sheet

I have been searching for an answer, more that likely using the wrong terminology, to my question and I have read through the Google documentation but I am now more confused than when I started looking for the answer.
I'm new to Google Apps and a complete beginner at Javascript. I recently started working in a Google Apps school (we have our own domain) and I have started developing some custom Google Sheets to aid other teachers and boost productivity.
I have developed a Sheet with some custom scripts and a custom menu bar to call the various functions of the script. Since I am so new to Javascript my scripts have some bugs that I fix as other users report them to me. However, my problem is that when I fix a bug in my "master" Sheet the end user must open the shared master Sheet and make a copy of it to benefit from the update. I want to update to be pushed out to all copies of the sheet (circa 4 copies)
I know need to deploy it but I don't know whether I need to deploy it as a web app or a sheets add-on from the script editor? Again, we have our own domain so I do believe I don't need to have it approved by Google to use it internally in our domain?
Based from this documentation, public add-ons require a review before publication, since you have your own domain, you can publish just for users within your domain without a review.
To publish an add-on for the first time, follow these steps. If you also want to let Google Apps domain administrators install and authorize your add-on for all users in their domain, follow the steps for domain-wide publication as well.
When you fixed your bugs and wanted it to be updated to all copies of sheets, you can follow this Update your add-on link to update an add-on that you have already published.
Open the add-on project in the script editor.
Make the necessary changes to your code, then save a new version of your project by clicking File > Manage versions, then Save
New Version. Close the Manage Versions dialog.
Click Publish > Deploy as add-on. (Or Sheets or Docs or Forms add-on.)
In the dialog that appears, change the add-on's details as needed, select the new version of your script, then click Update store
item. (If you change the add-on's name, make sure you also change
the name of the Apps Script project to match, as the project name is
shown in the authorization dialog.)
In the store listing, click Publish changes, then click OK in the dialog that appears.
Hope this helps!