You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

79 lines
2.9 KiB

  1. name: Release Application
  2. on:
  3. push:
  4. tags: ['v*']
  5. jobs:
  6. release:
  7. name: Create release
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Prepare release
  11. id: prepare_release
  12. run: |
  13. changelog="$(git diff HEAD^ HEAD -- CHANGELOG.md | grep -E '\+[#*]' | sed 's/^+//')"
  14. changelog="${changelog//$'%'/'%25'}"
  15. changelog="${changelog//$'\n'/'%0A'}"
  16. changelog="${changelog//$'\r'/'%0D'}"
  17. echo "::set-output name=changelog::$changelog"
  18. - name: Checkout code
  19. uses: actions/checkout@v2
  20. - name: Build locales
  21. env:
  22. POEDITOR_API_ACCESS: ${{ secrets.POEDITOR_API_ACCESS }}
  23. run: |
  24. make POEDITOR_API_ACCESS="${POEDITOR_API_ACCESS}" i18n
  25. tar cf locales.tar.gz kosmorrolib/locales
  26. - name: Create release
  27. id: create_release
  28. uses: actions/create-release@v1
  29. env:
  30. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  31. with:
  32. tag_name: ${{ github.ref }}
  33. release_name: Version ${{ github.ref }}
  34. draft: true
  35. prerelease: false
  36. body: |
  37. ${{ steps.prepare_release.outputs.changelog }}
  38. - name: Upload locales
  39. id: upload-locales
  40. uses: actions/upload-release-asset@v1
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  43. with:
  44. upload_url: ${{ steps.create_release.outputs.upload_url }}
  45. asset_path: ./locales.tar.gz
  46. asset_name: locales.tar.gz
  47. asset_content_type: application/x-tar
  48. pip:
  49. name: Release to PyPI
  50. runs-on: ubuntu-latest
  51. steps:
  52. - uses: actions/checkout@v1
  53. - name: Set up Python
  54. uses: actions/setup-python@v1
  55. with:
  56. python-version: '3.7'
  57. - name: Setup environment
  58. run: |
  59. sudo apt update
  60. sudo apt install ruby
  61. sudo gem install ronn
  62. - name: Install dependencies
  63. run: |
  64. python -m pip install --upgrade pip
  65. pip install setuptools wheel twine skyfield numpy tabulate Babel requests
  66. - name: Build and publish
  67. env:
  68. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  69. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  70. POEDITOR_API_ACCESS: ${{ secrets.POEDITOR_API_ACCESS }}
  71. POEDITOR_PROJECT_ID: 306433
  72. run: |
  73. make POEDITOR_API_ACCESS="${POEDITOR_API_ACCESS}" POEDITOR_PROJECT_ID="306433" build
  74. twine upload dist/*