Check new release #1222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check new release | |
on: | |
schedule: | |
- cron: '0 */12 * * *' | |
workflow_dispatch: | |
jobs: | |
check-new-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: denoland/setup-deno@v1 | |
- name: Check update | |
run: | | |
echo current_version=`npm view deno-bin version` >> $GITHUB_ENV | |
echo latest_version=`deno -V | awk '{print $2}'` >> $GITHUB_ENV | |
- name: Show versions | |
run: | | |
echo latest_version=${{ env.latest_version }} | |
echo current_version=${{ env.current_version }} | |
- name: Bump | |
if: env.latest_version != env.current_version | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
npm version ${{ env.latest_version }} | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > .npmrc | |
npm publish | |
- name: Push changes back | |
if: env.latest_version != env.current_version | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |