Skip to content

Prepare language packs for release #72

Prepare language packs for release

Prepare language packs for release #72

name: Prepare language packs for release
on:
workflow_dispatch:
inputs:
version:
description: "New version with format 'X.Y.postZ' or a hatch segment."
required: false
default: 'rev'
permissions:
contents: write
pull-requests: write
jobs:
prepare_release:
runs-on: ubuntu-latest
env:
TARGET_VERSION: ${{ github.event.inputs.version }}
CROWDIN_API_KEY: ${{ secrets.CROWDIN_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Set branch name and get hash
run: |
echo "BRANCH_NAME=pack-update-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Create a new branch
run: |
git checkout -b "${{ env.BRANCH_NAME }}"
- name: Set up git identity
run: |
git config user.name "JupyterLab Language Packs Bot"
git config user.email 'jupyterlab-bot@users.noreply.github.com'
- name: Update the language packages
run: |
python scripts/03_prepare_release.py --new-version "${{ github.event.inputs.version }}"
- name: Push the changes
run: |
git push --set-upstream origin "${{ env.BRANCH_NAME }}"
- name: Create a PR
run: |
gh pr create -B "main" -t "Update language packs to '${TARGET_VERSION:-auto}'" -b ""
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}