zhconv 0.4.1

Traditional, Simplified and regional Chinese variants converter powered by MediaWiki & OpenCC rulesets and the Aho-Corasick algorithm 中文简繁及地區詞轉換
Documentation
name: Deploy Worker
on:
  push:
  pull_request:
  repository_dispatch:
jobs:
  deploy:
    runs-on: ubuntu-latest
    # For Workers Deployment fork only
    if: github.repository != 'Gowee/zhconv-rs'
    timeout-minutes: 60
    steps:
      # - run: echo '${{ toJSON(github.event) }}' | jq .
      - uses: actions/checkout@v2
      - name: Activate OpenCC Dicts
        run: sed -i 's/default = \[/\0"opencc"/' worker/Cargo.toml
      - name: Disable other workflows in Workers fork
        if: github.run_number == 1 && github.event_name == 'repository_dispatch' && github.event.repository.fork == true
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          flows=$(gh workflow list --json 'name,id' --jq '.[] | select(.name != "${{ github.workflow }}") | .id')
          echo "Workflows to disable: $flows"
          for flow in $flows; do
            gh workflow disable $flow
          done
          # runs=$(gh run list --json 'databaseId' --jq '.[] | select(.databaseId != ${{ github.run_id }}) | .databaseId')
          # echo "Runs to cancel: $runs"
          # for run in $runs; do
          #   gh run cancel $run
          # done
      - name: Build & Deploy Worker
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          accountId: ${{ secrets.CF_ACCOUNT_ID }}
          workingDirectory: worker
# Note:
# To activate authentication, set the `API_TOKEN` secret, via the CF dashboard or `wrangler secret put API_TOKEN`.
# To change the 2MiB default request body limit, set the `BODY_LIMIT` envvar, via the dashboard or wrangler.toml.