release.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. sh ./bin/github-actions/update-readme.sh
  25. - name: Commit
  26. run: |
  27. git commit -am "Release v${{ env.RELEASE_VERSION }}"
  28. - name: Push tag
  29. run: |
  30. TMP_RELEASE_BRANCH=tmp/release-${{ env.RELEASE_VERSION }}
  31. git push origin HEAD:$TMP_RELEASE_BRANCH --follow-tags
  32. git push --delete origin $TMP_RELEASE_BRANCH
  33. - name: Upload release notes
  34. uses: Roang-zero1/github-create-release-action@master
  35. with:
  36. created_tag: v${{ env.RELEASE_VERSION }}
  37. env:
  38. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}