chore: add new cert fingerprint given by Google Play Console... (#2053) #402
This file contains hidden or 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: Browser extension release | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| # Allows to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| working-directory: browser-extension | |
| jobs: | |
| build_extension: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Check extension version in the manifest | |
| run: | | |
| ext_version=$(python -c 'import json; print(json.load(open("package.json"))["version"])') | |
| tag_exist=$(git tag -l "browser-extension-v$ext_version" | wc -l) | |
| echo "ext_version=$ext_version" >> $GITHUB_ENV | |
| echo "tag_exist=$tag_exist" >> $GITHUB_ENV | |
| - name: Create a new tag | |
| if: ${{ env.tag_exist == 0 }} | |
| run: | | |
| echo "Creation of a new tag: browser-extension-v${{ env.ext_version }}" | |
| git tag "browser-extension-v${{ env.ext_version }}" | |
| git push --tags | |
| - name: Build browser extension | |
| if: ${{ env.tag_exist == 0 }} | |
| run: | | |
| EXTENSION_BROWSER=firefox MANIFEST_VERSION=2 ./build.sh -o tournesol_extension_firefox.zip | |
| EXTENSION_BROWSER=chrome MANIFEST_VERSION=3 ./build.sh -o tournesol_extension_chrome.zip | |
| - name: Error message | |
| if: failure() | |
| run: > | |
| curl | |
| -F 'payload_json={"username": "ExtensionBot", | |
| "content": "Problem with the build of browser extension version **${{ env.ext_version }}**.\n | |
| More detail: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' | |
| ${{ secrets.DISCORD_BROWSER_EXTENSION_WEBHOOK_URL }} | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ env.tag_exist == 0 }} | |
| with: | |
| name: browser-extension-zipfiles | |
| path: browser-extension/tournesol_extension*.zip | |
| - name: Send zip file on Discord | |
| if: ${{ env.tag_exist == 0 }} | |
| run: > | |
| curl --fail | |
| -F 'payload_json={"username": "ExtensionBot", | |
| "content": "The browser extension version **${{ env.ext_version }}** has been built.\n | |
| More detail: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' | |
| -F "files[0]=@tournesol_extension_firefox.zip" | |
| -F "files[1]=@tournesol_extension_chrome.zip" | |
| ${{ secrets.DISCORD_BROWSER_EXTENSION_WEBHOOK_URL }} |