ci.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. - LICENSE
  11. - README.md
  12. pull_request:
  13. branches: [master]
  14. jobs:
  15. ci:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Checkout code
  19. uses: actions/checkout@v1 # v1 keeps tags
  20. with:
  21. fetch-depth: 100 # for revision index in version and the `has-changed-path` action
  22. - uses: actions/setup-node@v2
  23. with:
  24. node-version: '16'
  25. - name: Build
  26. env:
  27. SYNC_DROPBOX_CLIENT_ID: ${{ secrets.SYNC_DROPBOX_CLIENT_ID }}
  28. SYNC_GOOGLE_CLIENT_ID: ${{ secrets.SYNC_GOOGLE_CLIENT_ID }}
  29. SYNC_GOOGLE_CLIENT_SECRET: ${{ secrets.SYNC_GOOGLE_CLIENT_SECRET }}
  30. SYNC_GOOGLE_DESKTOP_ID: ${{ secrets.SYNC_GOOGLE_DESKTOP_ID }}
  31. SYNC_GOOGLE_DESKTOP_SECRET: ${{ secrets.SYNC_GOOGLE_DESKTOP_SECRET }}
  32. SYNC_ONEDRIVE_CLIENT_ID: ${{ secrets.SYNC_ONEDRIVE_CLIENT_ID }}
  33. SYNC_ONEDRIVE_CLIENT_SECRET: ${{ secrets.SYNC_ONEDRIVE_CLIENT_SECRET }}
  34. run: yarn && yarn build
  35. - name: Get version and SHA
  36. run: node scripts/action-helper.js ci
  37. - name: Upload Artifact
  38. uses: actions/upload-artifact@v2
  39. continue-on-error: true
  40. with:
  41. name: 'Violentmonkey-test-webext-${{ env.GIT_DESCRIBE }}'
  42. path: 'dist/*'
  43. if-no-files-found: error
  44. - name: Upload to Transifex - check src
  45. uses: marceloprado/has-changed-path@v1
  46. id: changed-path-src
  47. with:
  48. paths: src
  49. - name: Upload to Transifex
  50. if: steps.changed-path-src.outputs.changed == 'true'
  51. run: 'curl -i -L --user api:$TRANSIFEX_TOKEN -X PUT -F file=@dist/_locales/en/messages.json https://www.transifex.com/api/2/project/violentmonkey-nex/resource/messagesjson/content/'
  52. env:
  53. TRANSIFEX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}