| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- name: Release
- on:
- push:
- tags:
- - v*
- jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1 # v1 keeps tags
- with:
- fetch-depth: 250 # for `action-helper`
- # persist-credentials: false # not implemented in v1
- - uses: actions/setup-node@v2
- with:
- node-version: '16'
- - name: Prepare
- run: yarn && node scripts/action-helper.js
- - name: Build
- env:
- SYNC_DROPBOX_CLIENT_ID: ${{ secrets.SYNC_DROPBOX_CLIENT_ID }}
- SYNC_GOOGLE_CLIENT_ID: ${{ secrets.SYNC_GOOGLE_CLIENT_ID }}
- SYNC_GOOGLE_CLIENT_SECRET: ${{ secrets.SYNC_GOOGLE_CLIENT_SECRET }}
- SYNC_GOOGLE_DESKTOP_ID: ${{ secrets.SYNC_GOOGLE_DESKTOP_ID }}
- SYNC_GOOGLE_DESKTOP_SECRET: ${{ secrets.SYNC_GOOGLE_DESKTOP_SECRET }}
- SYNC_ONEDRIVE_CLIENT_ID: ${{ secrets.SYNC_ONEDRIVE_CLIENT_ID }}
- SYNC_ONEDRIVE_CLIENT_SECRET: ${{ secrets.SYNC_ONEDRIVE_CLIENT_SECRET }}
- run: |
- mkdir -p $ASSETS_DIR $TEMP_DIR
- # Create source zip
- git archive @ --format=zip > $TEMP_DIR/$SOURCE_ZIP
- # Build for release, also upload to GitHub assets
- yarn build
- cd dist && zip -r ../$ASSETS_DIR/$ASSET_ZIP . && cd ..
- # Build for CWS beta, append `BETA` to version name
- # Same as `BETA=1 yarn build` but only manifest is changed by now
- BETA=1 npx gulp manifest
- cd dist && zip -r ../$TEMP_DIR/$ASSET_CWS_BETA_ZIP . && cd ..
- # Build for AMO unlisted, append `BETA` to version name and set update_url for FF
- # Same as `yarn build:selfHosted` but only manifest is changed by now
- TARGET=selfHosted BETA=1 npx gulp manifest
- cd dist && zip -r ../$TEMP_DIR/$ASSET_SELF_HOSTED_ZIP . && cd ..
- - name: Publish to AMO
- id: signAMO
- continue-on-error: true
- run: |
- mkdir -p $TEMP_DIR/updates
- if [ "$PRERELEASE" != "true" ]; then
- # Publish listed version, ignore error since we don't need to download it
- node scripts/amo-upload.mjs || 0
- fi
- # Publish unlisted version
- BETA=1 node scripts/amo-upload.mjs
- env:
- AMO_KEY: ${{ secrets.AMO_KEY }}
- AMO_SECRET: ${{ secrets.AMO_SECRET }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Update updates.json
- uses: JamesIves/[email protected]
- if: steps.signAMO.outcome == 'success'
- with:
- branch: updates
- folder: ${{ env.TEMP_DIR }}/updates
- commit-message: Update to ${{ env.VERSION }} 🚀
- - name: Publish to CWS
- continue-on-error: true
- run: |
- set -x
- if [ "$PRERELEASE" != "true" ]; then
- # Publish release
- npx chrome-webstore-upload-cli@1 upload --extension-id $EXTENSION_ID_RELEASE --source $ASSETS_DIR/$ASSET_ZIP --auto-publish
- fi
- # Always publish prerelease
- npx chrome-webstore-upload-cli@1 upload --extension-id $EXTENSION_ID_BETA --source $TEMP_DIR/$ASSET_CWS_BETA_ZIP --auto-publish
- env:
- EXTENSION_ID_BETA: opokoaglpekkimldnlggpoagmjegichg
- EXTENSION_ID_RELEASE: jinjaccalgkegednnccohejagnlnfdag
- CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }}
- CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }}
- REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }}
- - name: Create/Update Release
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- node -e 'require("./scripts/release-helper").uploadAssets()';
|