Skip to content

chore(deps): update dependency deno to v2.9.6 (#80) #184

chore(deps): update dependency deno to v2.9.6 (#80)

chore(deps): update dependency deno to v2.9.6 (#80) #184

name: Release Drafter
on:
push:
branches:
- main
permissions:
contents: read
jobs:
update_release_draft:
name: Update Release Draft
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
outputs:
resolved_version: ${{ steps.draft_release.outputs.resolved_version }}
tag_name: ${{ steps.draft_release.outputs.tag_name }}
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Draft Release
id: draft_release
uses: release-drafter/release-drafter@v7
with:
config-name: release-drafter-config.yml
commitish: main
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
update_package_version:
name: Update Package Version
runs-on: ubuntu-latest
needs: update_release_draft
if: github.event_name == 'push' &&
needs.update_release_draft.outputs.resolved_version != ''
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Get current version
id: current_version
run: |
CURRENT_VERSION=$(jq -r '.version' jsr.json)
printf 'current_version=%s\n' "$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
- name: Check if version update needed
id: version_check
run: |
CURRENT_VERSION="${{ steps.current_version.outputs.current_version }}"
NEW_VERSION="${{ needs.update_release_draft.outputs.resolved_version }}"
if [ "$CURRENT_VERSION" = "$NEW_VERSION" ]; then
printf 'needs_update=false\n' >> "$GITHUB_OUTPUT"
printf '::notice::Version is already up to date (%s)\n' "$NEW_VERSION"
else
printf 'needs_update=true\n' >> "$GITHUB_OUTPUT"
printf '::notice::Version update needed: %s -> %s\n' "$CURRENT_VERSION" "$NEW_VERSION"
fi
- name: Update jsr.json version
if: steps.version_check.outputs.needs_update == 'true'
run: |
NEW_VERSION="${{ needs.update_release_draft.outputs.resolved_version }}"
jq --arg version "$NEW_VERSION" '.version = $version' jsr.json > jsr.json.tmp
mv jsr.json.tmp jsr.json
- name: Update deno.json version
if: steps.version_check.outputs.needs_update == 'true'
run: |
NEW_VERSION="${{ needs.update_release_draft.outputs.resolved_version }}"
if jq -e '.version' deno.json > /dev/null 2>&1; then
jq --arg version "$NEW_VERSION" '.version = $version' deno.json > deno.json.tmp
mv deno.json.tmp deno.json
fi
- name: Update packages/deno.json version
if: steps.version_check.outputs.needs_update == 'true'
run: |
NEW_VERSION="${{ needs.update_release_draft.outputs.resolved_version }}"
if [ -f packages/deno.json ] && jq -e '.version' packages/deno.json > /dev/null 2>&1; then
jq --arg version "$NEW_VERSION" '.version = $version' packages/deno.json > packages/deno.json.tmp
mv packages/deno.json.tmp packages/deno.json
fi
- name: Create Pull Request
if: steps.version_check.outputs.needs_update == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: "chore: bump version to ${{
needs.update_release_draft.outputs.resolved_version }}"
title: "chore: bump version to ${{ needs.update_release_draft.outputs.resolved_version }}"
body: |
## Version Bump
This PR updates the package version to `${{ needs.update_release_draft.outputs.resolved_version }}` based on the release draft.
### Changes
- Updated `jsr.json` version to `${{ needs.update_release_draft.outputs.resolved_version }}`
- Updated `deno.json` version (if present)
- Updated `packages/deno.json` version (if present)
### Related
- Release Tag: `${{ needs.update_release_draft.outputs.tag_name }}`
- Previous Version: `${{ steps.current_version.outputs.current_version }}`
---
*This PR was automatically generated by the release-drafter workflow.*
branch: build/version-bump-${{ needs.update_release_draft.outputs.resolved_version }}
delete-branch: true
labels: |
:skateboard: skip-changelog
base: main