release.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: GitHub Release
  2. on:
  3. push:
  4. branches:
  5. - release/**
  6. jobs:
  7. release:
  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://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
  18. - name: Bump version
  19. run: |
  20. npm --no-git-tag-version version patch
  21. export RELEASE_VERSION=`npm run version --silent`
  22. sh ./bin/github-actions/update-readme.sh
  23. echo ::set-env name=RELEASE_VERSION::$RELEASE_VERSION
  24. - name: Checkout, Commit, Tag and Push
  25. run: |
  26. TMP_RELEASE_BRANCH=tmp/release-${{ env.RELEASE_VERSION }}
  27. git checkout -B $TMP_RELEASE_BRANCH
  28. git commit -am "Release v${{ env.RELEASE_VERSION }}"
  29. git tag -a v${{ env.RELEASE_VERSION }} -m "v${{ env.RELEASE_VERSION }}"
  30. git push --follow-tags origin $TMP_RELEASE_BRANCH
  31. git push --delete origin $TMP_RELEASE_BRANCH
  32. - name: Upload release notes
  33. uses: Roang-zero1/github-create-release-action@master
  34. with:
  35. created_tag: v${{ env.RELEASE_VERSION }}
  36. env:
  37. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}