release.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: GitHub Release
  2. on:
  3. push:
  4. branches:
  5. - release/**
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v1
  11. with:
  12. fetch-depth: 1
  13. - name: Init Git
  14. run: |
  15. git config --local user.name "GitHub Action"
  16. git config --local user.email "info@weseek.co.jp"
  17. git remote set-url origin "https://${{ env.GITHUB_ACTOR }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ env.${{ env.RELEASE_VERSION }} }}"
  18. - name: Bump version
  19. run: |
  20. npm version patch
  21. export RELEASE_VERSION=`npm run version --silent`
  22. echo ::set-env name=RELEASE_VERSION::$RELEASE_VERSION
  23. - name: Update README.md
  24. run: |
  25. sh ./bin/github-actions/update-readme.sh
  26. - name: Commit
  27. run: |
  28. git commit -am "Release v${{ env.RELEASE_VERSION }}"
  29. - name: Push tag
  30. run: |
  31. TMP_RELEASE_BRANCH=tmp/release-${{ env.RELEASE_VERSION }}
  32. git push origin HEAD:$TMP_RELEASE_BRANCH --follow-tags
  33. git push --delete origin $TMP_RELEASE_BRANCH
  34. - name: Upload release notes
  35. uses: Roang-zero1/github-create-release-action@master
  36. with:
  37. created_tag: v${{ env.RELEASE_VERSION }}
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}