Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork214
feat: automation with github action#102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: build | ||
on: | ||
pull_request: | ||
branches: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Dependencies | ||
run: sudo apt-get install gettext | ||
- name: Build | ||
run: VERSION=${{ github.event.pull_request.base.ref }} make |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: deploy-gh-page | ||
on: | ||
push: | ||
branches: | ||
- "3.9" | ||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Dependencies | ||
run: sudo apt-get install gettext | ||
- name: Build | ||
run: make | ||
- name: Deploy to gh page | ||
uses: JamesIves/github-pages-deploy-action@3.7.1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: ../cpython/Doc/build/html | ||
CLEAN: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: python-3.9-sync-with-cpython | ||
on: | ||
push: | ||
branches: | ||
- "3.9" | ||
schedule: | ||
- cron: "0 0 * * *" | ||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
env: | ||
VERSION: "3.9" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ env.VERSION }} | ||
- name: Set env | ||
run: echo "LATEST_COMMIT_ID=$(git ls-remote https://github.com/python/CPython.git $VERSION | head -c 8)" >> $GITHUB_ENV | ||
- name: Install Dependencies | ||
run: sudo apt-get install gettext | ||
- name: Sync with CPython | ||
run: make clone && make merge && make rm_cpython | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
commit-message: sync with cpython ${{ env.LATEST_COMMIT_ID }} | ||
committer: GitHub <noreply@github.com> | ||
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | ||
base: ${{ env.VERSION }} | ||
branch: cron/sync/${{ env.VERSION }} | ||
delete-branch: true | ||
title: 'Sync with CPython ${{ env.VERSION }}' | ||
body: | | ||
Sync with CPython ${{ env.VERSION }} | ||
labels: | | ||
sync-cpython | ||
automation | ||
team-reviewers: | | ||
owners | ||
maintainers | ||
- name: Check outputs | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -22,20 +22,20 @@ LC_MESSAGES := $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES | ||
VENV := ~/.venvs/python-docs-i18n/ | ||
PYTHON := $(shell which python3) | ||
MODE := autobuild-dev-html | ||
BRANCH:= $(or $(VERSION), $(shell git describe --contains --all HEAD)) | ||
CollaboratorAuthor
| ||
JOBS = 1 | ||
.PHONY: all | ||
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurbclone | ||
mkdir -p $(LC_MESSAGES) | ||
for dirname in $$(find . -name '*.po' | xargs -n1 dirname | sort -u | grep -v '^\.$$'); do mkdir -p $(LC_MESSAGES)/$$dirname; done | ||
for file in *.po */*.po; do ln -f $$file $(LC_MESSAGES)/$$file; done | ||
. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE) | ||
clone: | ||
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE) || echo "cpython exists" | ||
cd $(CPYTHON_CLONE) && git checkout $(BRANCH) | ||
@@ -104,3 +104,7 @@ update_txconfig: | ||
.PHONY: fuzzy | ||
fuzzy: | ||
for file in *.po */*.po; do echo $$(msgattrib --only-fuzzy --no-obsolete "$$file" | grep -c '#, fuzzy') $$file; done | grep -v ^0 | sort -gr | ||
.PHONY: rm_cpython | ||
rm_cpython: | ||
rm -rf $(CPYTHON_CLONE) |