ci.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: CI
  2. on:
  3. push:
  4. branches: [master]
  5. tags-ignore:
  6. - 'v*' # version-tagged commits are releases which have their own workflow
  7. paths-ignore:
  8. - '.github/**' # this ci.yml is also excluded so you need to re-run it explicitly if necessary
  9. - LICENSE
  10. - README.md
  11. pull_request:
  12. branches: [master]
  13. jobs:
  14. ci:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Checkout code
  18. uses: actions/checkout@v2
  19. with:
  20. fetch-depth: 2 # for the `has-changed-path` action
  21. - uses: actions/setup-node@v2
  22. with:
  23. node-version: '15'
  24. - name: Build
  25. run: yarn && yarn build
  26. - name: Upload Artifact - get version
  27. uses: nyaa8/package-version@v1
  28. - name: Upload Artifact - get short SHA
  29. uses: benjlevesque/[email protected]
  30. id: short-sha
  31. - name: Upload Artifact
  32. uses: actions/upload-artifact@v2
  33. continue-on-error: true
  34. with:
  35. name: 'Violentmonkey-test-webext-v${{ env.PACKAGE_VERSION }}-git${{ steps.short-sha.outputs.sha }}'
  36. path: 'dist/*'
  37. if-no-files-found: error
  38. retention-days: 30
  39. - name: Upload to Transifex - check src
  40. uses: marceloprado/has-changed-path@v1
  41. id: changed-path-src
  42. with:
  43. paths: src
  44. - name: Upload to Transifex
  45. if: steps.changed-path-src.outputs.changed == 'true'
  46. 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/'
  47. env:
  48. TRANSIFEX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}