Bumped version
to 2024.10.13
#1
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 AMO on version bump | |
on: | |
push: | |
branches: [main] | |
paths: [firefox/extension/manifest.json] | |
jobs: | |
check-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout adamlui/you.com-omnibox | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.REPO_SYNC_PAT }} | |
repository: adamlui/you.com-omnibox | |
path: adamlui/you-omnibox | |
fetch-depth: 2 | |
- name: Check manifest for version bump | |
run: | | |
cd ${{ github.workspace }}/adamlui/you-omnibox | |
CURRENT_VER=$(cat firefox/extension/manifest.json | grep '"version"' | sed -E 's/.*"version": "(.*)".*/\1/') | |
PREV_VER=$(git show HEAD^:firefox/extension/manifest.json | grep '"version"' | sed -E 's/.*"version": "(.*)".*/\1/') | |
if [ "$(printf '%s\n' "$PREV_VER" "$CURRENT_VER" | sort -V | head -n 1)" != "$CURRENT_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 ${{ github.workspace }}/adamlui/you-omnibox/firefox/extension | |
zip -r ../../extension.zip . | |
- name: Publish to AMO | |
if: env.version_changed == 'true' | |
uses: yayuyokitano/[email protected] | |
with: | |
api_key: ${{ secrets.AMO_ISSUER }} | |
api_secret: ${{ secrets.AMO_SECRET }} | |
guid: "[email protected]" | |
xpi_path: ${{ github.workspace }}/adamlui/you-omnibox/extension.zip |