manual-cdn.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. name: Manually triggered CDN upload
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. package:
  6. description: Package to upload
  7. required: true
  8. type: choice
  9. options:
  10. - uppy
  11. - '@uppy/locales'
  12. version:
  13. description: Version to upload (from npm)
  14. type: string
  15. force:
  16. description: --force
  17. type: boolean
  18. default: false
  19. env:
  20. YARN_ENABLE_GLOBAL_CACHE: false
  21. jobs:
  22. upload:
  23. runs-on: ubuntu-latest
  24. steps:
  25. - name: Checkout sources
  26. uses: actions/checkout@v4
  27. - name: Get yarn cache directory path
  28. id: yarn-cache-dir-path
  29. run:
  30. echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  31. - uses: actions/cache@v4
  32. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  33. with:
  34. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  35. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  36. restore-keys: |
  37. ${{ runner.os }}-yarn-
  38. - name: Install Node.js
  39. uses: actions/setup-node@v4
  40. with:
  41. node-version: lts/*
  42. - name: Install upload-to-cdn dependencies
  43. if: ${{ inputs.version }}
  44. run: corepack yarn workspaces focus @uppy-dev/upload-to-cdn
  45. env:
  46. # https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
  47. CYPRESS_INSTALL_BINARY: 0
  48. - name: Install all dependencies
  49. if: ${{ !inputs.version }}
  50. run: corepack yarn install --immutable
  51. env:
  52. # https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
  53. CYPRESS_INSTALL_BINARY: 0
  54. - name: Build before publishing
  55. if: ${{ !inputs.version }}
  56. run: corepack yarn run build
  57. - name: Upload "${{ inputs.package }}" to CDN
  58. if: ${{ !inputs.force }}
  59. run: corepack yarn run uploadcdn "$PACKAGE" "$VERSION"
  60. env:
  61. PACKAGE: ${{inputs.package}}
  62. VERSION: ${{inputs.version}}
  63. EDGLY_KEY: ${{secrets.EDGLY_KEY}}
  64. EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
  65. - name: Upload "${{ inputs.package }}" to CDN
  66. if: ${{ inputs.force }}
  67. run: corepack yarn run uploadcdn "$PACKAGE" "$VERSION" -- --force
  68. env:
  69. PACKAGE: ${{inputs.package}}
  70. VERSION: ${{inputs.version}}
  71. EDGLY_KEY: ${{secrets.EDGLY_KEY}}
  72. EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}