ci.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_GOOGLE_CLIENT_ID: ${{ secrets.SYNC_GOOGLE_CLIENT_ID }}
  28. SYNC_GOOGLE_CLIENT_SECRET: ${{ secrets.SYNC_GOOGLE_CLIENT_SECRET }}
  29. SYNC_ONEDRIVE_CLIENT_ID: ${{ secrets.SYNC_ONEDRIVE_CLIENT_ID }}
  30. SYNC_ONEDRIVE_CLIENT_SECRET: ${{ secrets.SYNC_ONEDRIVE_CLIENT_SECRET }}
  31. run: yarn && yarn build
  32. - name: Get version and SHA
  33. run: node scripts/action-helper.js ci
  34. - name: Upload Artifact
  35. uses: actions/upload-artifact@v2
  36. continue-on-error: true
  37. with:
  38. name: 'Violentmonkey-test-webext-${{ env.GIT_DESCRIBE }}'
  39. path: 'dist/*'
  40. if-no-files-found: error
  41. - name: Upload to Transifex - check src
  42. uses: marceloprado/has-changed-path@v1
  43. id: changed-path-src
  44. with:
  45. paths: src
  46. - name: Upload to Transifex
  47. if: steps.changed-path-src.outputs.changed == 'true'
  48. 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/'
  49. env:
  50. TRANSIFEX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}