Skip to content

Instantly share code, notes, and snippets.

@lewisrodgers
Last active June 24, 2024 13:47
Show Gist options
  • Save lewisrodgers/dd39d48baf6cb041fd56a3ced01afcf1 to your computer and use it in GitHub Desktop.
Save lewisrodgers/dd39d48baf6cb041fd56a3ced01afcf1 to your computer and use it in GitHub Desktop.
Chrome extension basic pipeline
pipelines:
branches:
develop:
- step:
name: Update
script:
- apt-get update
- apt-get -y install jq zip
- FILE_NAME=crx.zip
- zip -r $FILE_NAME ./app
- ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&refresh_token=$REFRESH_TOKEN&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r '.access_token')
- curl -H "Authorization:Bearer $ACCESS_TOKEN" -H "x-goog-api-version:2" -X PUT -T $FILE_NAME -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/$APP_ID"
master:
- step:
name: Publish to trusted testers
script:
- apt-get update
- apt-get -y install jq zip
- FILE_NAME=crx.zip
- zip -r $FILE_NAME ./app
- ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&refresh_token=$REFRESH_TOKEN&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r '.access_token')
- curl -H "Authorization:Bearer $ACCESS_TOKEN" -H "x-goog-api-version:2" -H "Content-Length:0" -H "publishTarget:trustedTesters" -X POST -v "https://www.googleapis.com/chromewebstore/v1.1/items/$APP_ID/publish"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment