ci.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: CI
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches: [master]
  6. tags-ignore:
  7. - 'v*' # version-tagged commits are releases which have their own workflow
  8. paths-ignore:
  9. - '.github/**' # this ci.yml is also excluded so you need to re-run it explicitly if necessary
  10. - src/types.d.ts
  11. - LICENSE
  12. - README.md
  13. pull_request:
  14. branches: [master]
  15. jobs:
  16. ci:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout code
  20. uses: actions/checkout@v1 # v1 keeps tags
  21. with:
  22. fetch-depth: 100 # for revision index in version and the `has-changed-path` action
  23. - uses: actions/setup-node@v3
  24. with:
  25. node-version: '20'
  26. - name: Build
  27. env:
  28. SYNC_DROPBOX_CLIENT_ID: ${{ secrets.SYNC_DROPBOX_CLIENT_ID }}
  29. SYNC_GOOGLE_CLIENT_ID: ${{ secrets.SYNC_GOOGLE_CLIENT_ID }}
  30. SYNC_GOOGLE_CLIENT_SECRET: ${{ secrets.SYNC_GOOGLE_CLIENT_SECRET }}
  31. SYNC_GOOGLE_DESKTOP_ID: ${{ secrets.SYNC_GOOGLE_DESKTOP_ID }}
  32. SYNC_GOOGLE_DESKTOP_SECRET: ${{ secrets.SYNC_GOOGLE_DESKTOP_SECRET }}
  33. SYNC_ONEDRIVE_CLIENT_ID: ${{ secrets.SYNC_ONEDRIVE_CLIENT_ID }}
  34. SYNC_ONEDRIVE_CLIENT_SECRET: ${{ secrets.SYNC_ONEDRIVE_CLIENT_SECRET }}
  35. run: yarn && yarn build
  36. - name: Get version and SHA
  37. run: node scripts/action-helper.js ci
  38. - name: Upload Artifact
  39. uses: actions/upload-artifact@v3
  40. continue-on-error: true
  41. with:
  42. name: 'Violentmonkey-test-webext-${{ env.GIT_DESCRIBE }}'
  43. path: 'dist/*'
  44. if-no-files-found: error
  45. - name: Upload to Transifex - check src
  46. if: github.event_name == 'push' || github.event.pull_request.merged == true
  47. uses: marceloprado/[email protected]
  48. id: changed-path-src
  49. with:
  50. paths: src
  51. - name: Upload to Transifex
  52. if: steps.changed-path-src.outputs.changed == 'true'
  53. run: node scripts/transifex.mjs update
  54. env:
  55. TRANSIFEX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}