Bumped version
to 2024.12.2
#32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to CWS + EWS on Chrome version bump | |
on: | |
push: | |
branches: [main] | |
paths: [chrome/extension/manifest.json] | |
jobs: | |
check-version-to-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout adamlui/chatgpt-widescreen | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: chrome | |
fetch-depth: 2 | |
- name: Check Chrome manifest for version bump | |
run: | | |
current_ver=$(cat chrome/extension/manifest.json | grep '"version"' | sed -E 's/.*"version": "(.*)".*/\1/') | |
prev_ver=$(git show HEAD^:chrome/extension/manifest.json | grep '"version"' | sed -E 's/.*"version": "(.*)".*/\1/') | |
if [ "$current_ver" != "$prev_ver" ] ; then | |
echo "Extension updated from $prev_ver to $current_ver" | |
echo "VERSION_CHANGED=true" >> $GITHUB_ENV | |
else echo "VERSION_CHANGED=false" >> $GITHUB_ENV ; fi | |
- name: Create zipball | |
if: env.VERSION_CHANGED == 'true' | |
run: | | |
cd chrome/extension | |
zip -r ../../extension.zip . | |
- name: Publish to CWS | |
if: env.VERSION_CHANGED == 'true' | |
uses: mobilefirstllc/cws-publish@latest | |
with: | |
action: publish | |
extension_id: jgnjpnmofkalfliddjelaciggjgnphgm | |
client_id: ${{ secrets.CWS_CLIENT_ID }} | |
client_secret: ${{ secrets.CWS_CLIENT_SECRET }} | |
refresh_token: ${{ secrets.CWS_REFRESH_TOKEN }} | |
zip_file: extension.zip | |
continue-on-error: true | |
- name: Publish to EWS | |
if: env.VERSION_CHANGED == 'true' | |
uses: wdzeng/edge-addon@v2 | |
with: | |
product-id: ${{ secrets.EWS_PRODUCT_ID }} | |
client-id: ${{ secrets.EWS_CLIENT_ID }} | |
api-key: ${{ secrets.EWS_CLIENT_SECRET }} | |
zip-path: extension.zip | |
continue-on-error: true |