.github/workflows/check-for-new-deno-release.yml #222
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
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "18 0 * * *" | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
latest-deno-version: ${{ steps.check.outputs.latest-deno-version }} | |
release-status: ${{ steps.check.outputs.release-status }} | |
steps: | |
- name: Check for new deno release | |
id: check | |
run: | | |
latest_deno_version=$(gh release view --repo denoland/deno --json tagName --jq ".tagName") | |
echo "latest-deno-version=$latest_deno_version" >> "$GITHUB_OUTPUT" | |
version_in_this_repo=$(gh release view $latest_deno_version --repo ${{ github.repository }} --json tagName --jq ".tagName" || true) | |
if [[ "${latest_deno_version}" == "${version_in_this_repo}" ]] | |
then | |
echo "release-status=exists" >> "$GITHUB_OUTPUT" | |
else | |
echo "release-status=new" >> "$GITHUB_OUTPUT" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
needs: | |
- check | |
if: ${{ needs.check.outputs.release-status == 'new' }} | |
uses: ./.github/workflows/build.yml | |
with: | |
deno-version: ${{ needs.check.outputs.latest-deno-version }} |