Skip to content

Open PR for release #19

Open PR for release

Open PR for release #19

Workflow file for this run

name: Open PR for release
on:
workflow_dispatch:
inputs:
update:
required: true
type: choice
options:
- patch
- minor
- major
release_type:
description: 'Release type'
required: true
type: choice
options:
- stable
- dev
default: stable
jobs:
open-pr-for-release:
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.13'
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
cache: 'npm'
cache-dependency-path: modal-js/package-lock.json
- name: Install npm packages
run: npm install
working-directory: ./modal-js
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- name: Config git user
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Switch to ci-release and make release commits
run: |
git switch -c ci-release
python ci/release.py version ${{ inputs.update }} ${{ inputs.release_type == 'dev' && '--dev' || '' }}
git push origin ci-release --force
- name: Create Pull Request
run: |
PR_TITLE="$(git log -1 --pretty=%B)"
gh pr create --title "$PR_TITLE" --body "$PR_TITLE" --base main --head ci-release
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}