Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
adrianliaw merged 2 commits intopython:3.9frommattwang44:automated-with-gh-action
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions.github/workflows/ci.yml
View file
Open in desktop
Original file line numberDiff line numberDiff 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
26 changes: 26 additions & 0 deletions.github/workflows/deploy-gh-page.yml
View file
Open in desktop
Original file line numberDiff line numberDiff 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
52 changes: 52 additions & 0 deletions.github/workflows/py39-sync-cpython.yml
View file
Open in desktop
Original file line numberDiff line numberDiff 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 }}"
12 changes: 8 additions & 4 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 = $(shell git describe --contains --all HEAD)
BRANCH:= $(or $(VERSION), $(shell git describe --contains --all HEAD))
Copy link
CollaboratorAuthor

@mattwang44mattwang44Oct 21, 2021
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Before this change, make commands would fail if run on branches other than3.7,3.8,3.9 etc. It allows users to run Makefile commands on branches with customized name by inserting an argument namedVERSION.

VERSION=3.9 make

josix reacted with thumbs up emoji
JOBS = 1


.PHONY: all
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb$(SPHINX_CONF)
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)


$(SPHINX_CONF):
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE)
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)


Expand DownExpand Up@@ -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)

[8]ページ先頭

©2009-2025 Movatter.jp