Skip to content

Commit 5b75d5f

Browse files
committed
Upstream changes, master branch now become main
2 parents 9eaee06 + f191a30 commit 5b75d5f

17 files changed

Lines changed: 89 additions & 64 deletions

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Translation bug
4-
url: https://github.com/progit/progit2/blob/master/TRANSLATING.md
4+
url: https://github.com/progit/progit2/blob/main/TRANSLATING.md
55
about: Refer to this table to find out where to report translation bugs.
66

77
- name: Report bugs for git-scm.com site

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- Should your changes appear in a printed edition, you'll be included in the contributors list. -->
44

55
<!-- Mark the checkbox [X] or [x] if you agree with the item. -->
6-
- [ ] I provide my work under the [project license](https://github.com/progit/progit2/blob/master/LICENSE.asc).
6+
- [ ] I provide my work under the [project license](https://github.com/progit/progit2/blob/main/LICENSE.asc).
77
- [ ] I grant such license of my work as is required for the purposes of future print editions to [Ben Straub](https://github.com/ben) and [Scott Chacon](https://github.com/schacon).
88

99
## Changes

.github/workflows/pr-build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pull Request Build
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: 2.7
17+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
18+
19+
- name: Build book
20+
run: bundle exec rake book:build
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release on push to main
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Compute tag name
16+
id: compute-tag
17+
run: |
18+
echo Computing next tag number
19+
LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3)
20+
PATCH=$(($LASTPATCH+1))
21+
echo "::set-output name=tagname::2.1.${PATCH}"
22+
23+
- name: Set up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: 2.7
27+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
28+
29+
- name: Build release assets
30+
run: bundle exec rake book:build
31+
32+
- name: Create release
33+
uses: ncipollo/release-action@v1
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
tag: ${{ steps.compute-tag.outputs.tagname }}
37+
commit: main
38+
artifacts: './progit.epub,./progit.mobi,./progit.pdf,./progit.html'

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'rake', '13.0.3'
3+
gem 'rake', '13.0.6'
44
gem 'asciidoctor', '2.0.15'
55

66
gem 'json', '2.5.1'
@@ -14,3 +14,4 @@ gem 'pygments.rb', '2.2.0'
1414
gem 'thread_safe', '0.3.6'
1515
gem 'epubcheck-ruby', '4.2.5.0'
1616
gem 'html-proofer', '3.19.2'
17+
gem 'kindlegen', '3.1.1'

README.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
Подобно на първото издание на книгата и текущото такова е с отворен код, лицензирано според Creative Commons лиценза.
88

9-
Няколко неща са променени в сравнение с първото издание.
10-
Например, за текста на книгата ние вече използваме чудесния AsciiDoc формат вместо Markdown; можете да видите https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/[AsciiDoc бързия справочник].
9+
Няколко неща са променени от момента, в който първото издание стана с отворен код.
10+
Например, за текста на книгата вече използваме чудесния AsciiDoc формат вместо Markdown; можете да видите https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/[AsciiDoc бързия справочник].
1111

1212
Също така, вместо в отделни директории на английското хранилище, вече съхраняваме преводите в отделни самостоятелни хранилища за всеки език.
1313
Погледнете link:TRANSLATING.md[указанията за сътрудничество] за повече информация.

Rakefile

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
namespace :book do
2-
def exec_or_raise(command)
3-
puts `#{command}`
4-
if (! $?.success?)
5-
raise "'#{command}' failed"
6-
end
7-
end
82

93
# Variables referenced for build
10-
version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp
4+
version_string = `git describe --tags`.chomp
115
if version_string.empty?
126
version_string = '0'
137
end
@@ -28,7 +22,7 @@ namespace :book do
2822
puts "Hash on header of contributors list (#{header_hash}) matches the current HEAD (#{current_head_hash})"
2923
else
3024
puts "Hash on header of contributors list (#{header_hash}) does not match the current HEAD (#{current_head_hash}), refreshing"
31-
`rm book/contributors.txt`
25+
sh "rm book/contributors.txt"
3226
# Reenable and invoke task again
3327
Rake::Task['book/contributors.txt'].reenable
3428
Rake::Task['book/contributors.txt'].invoke
@@ -58,16 +52,16 @@ namespace :book do
5852
desc 'generate contributors list'
5953
file 'book/contributors.txt' do
6054
puts 'Generating contributors list'
61-
`echo "Contributors as of #{header_hash}:\n" > book/contributors.txt`
62-
`git shortlog -s | grep -v -E "(Straub|Chacon|dependabot)" | cut -f 2- | column -c 120 >> book/contributors.txt`
55+
sh "echo 'Contributors as of #{header_hash}:\n' > book/contributors.txt"
56+
sh "git shortlog -s | grep -v -E '(Straub|Chacon|dependabot)' | cut -f 2- | column -c 120 >> book/contributors.txt"
6357
end
6458

6559
desc 'build HTML format'
6660
task :build_html => 'book/contributors.txt' do
6761
check_contrib()
6862

6963
puts 'Converting to HTML...'
70-
`bundle exec asciidoctor #{params} -a data-uri progit.asc`
64+
sh "bundle exec asciidoctor #{params} -a data-uri progit.asc"
7165
puts ' -- HTML output at progit.html'
7266

7367
end
@@ -77,7 +71,7 @@ namespace :book do
7771
check_contrib()
7872

7973
puts 'Converting to EPub...'
80-
`bundle exec asciidoctor-epub3 #{params} progit.asc`
74+
sh "bundle exec asciidoctor-epub3 #{params} progit.asc"
8175
puts ' -- Epub output at progit.epub'
8276

8377
end
@@ -87,7 +81,7 @@ namespace :book do
8781
check_contrib()
8882

8983
puts "Converting to Mobi (kf8)..."
90-
`bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc`
84+
sh "bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc"
9185
puts " -- Mobi output at progit.mobi"
9286
end
9387

@@ -96,16 +90,16 @@ namespace :book do
9690
check_contrib()
9791

9892
puts 'Converting to PDF... (this one takes a while)'
99-
`bundle exec asciidoctor-pdf #{params} progit.asc 2>/dev/null`
93+
sh "bundle exec asciidoctor-pdf #{params} progit.asc 2>/dev/null"
10094
puts ' -- PDF output at progit.pdf'
10195
end
10296

10397
desc 'Check generated books'
10498
task :check => [:build_html, :build_epub] do
10599
puts 'Checking generated books'
106100

107-
exec_or_raise('htmlproofer --check-html progit.html')
108-
exec_or_raise('epubcheck progit.epub')
101+
sh "htmlproofer --check-html progit.html"
102+
sh "epubcheck progit.epub"
109103
end
110104

111105
desc 'Clean all generated files'

TRANSLATING.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,13 @@ On https://git-scm.com, the translations are divided into three categories. Once
7272
| Partial translations available in | up to chapter 6 has been translated. |
7373
| Full translation available in |the book is (almost) fully translated. |
7474

75-
## Continuous integration with Travis CI
75+
## Continuous integration with GitHub Actions
7676

77-
Travis CI is a [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) service that integrates with GitHub. Travis CI is used to ensure that a pull-request doesn't break the build or compilation. Travis CI can also provide compiled versions of the book.
77+
GitHub Actions is a [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) service that integrates with GitHub. GitHub Actions is used to ensure that a pull-request doesn't break the build or compilation. GitHub Actions can also provide compiled versions of the book.
7878

79-
Setting up Travis CI requires administrative control over the repository.
80-
81-
### Registering for Travis continuous integration
82-
83-
1. Register a Travis account [here](https://travis-ci.org/).
84-
1. Register your project in Travis.
85-
Please refer to the [Travis documentation](https://docs.travis-ci.com/) for more information.
86-
87-
### Setting up your repository for continuous integration
88-
89-
Travis CI works by scanning your project's root directory for a file named `.travis.yml` and following the 'recipe' that it contains. The good news is: there's already a working `.travis.yml` file in the Pro Git 2 source [here](https://raw.githubusercontent.com/progit/progit2-pub/master/travis.yml).
90-
Copy that file, and put it in your working directory. Commit the .yml file and push it to your translation repository; that should fire up a compilation and a check of the book's contents.
79+
The configuration for GitHub Actions is contained in the `.github/workflows` directory, and if you bring in the `main` branch of the root repository you'll get them for free.
80+
However, if you created your translation repo by _forking_ the root repo, there's an extra step you must complete (if you did not fork, you can skip this part).
81+
GitHub assumes that forks will be used to contribute to the repo from which they were forked, so you'll have to visit the "Actions" tab on your forked repo, and click the "I understand my workflows" button to allow the actions to run.
9182

9283
## Setting up a publication chain for e-books
9384

atlas.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"branch": "master",
2+
"branch": "main",
33
"files": [
44
"book/cover.html",
55
"LICENSE.asc",

book/07-git-tools/sections/credentials.asc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ include::../git-credential-read-only[]
174174
<3> Цикълът чете вход от stdin докато срещне празен ред.
175175
Подадените стойности се пазят в `known` хеша за по-късно ползване.
176176
<4> Този цикъл чете съдържанието на storage файла, търсейки съвпадения.
177-
Ако протоколът и хостът от `known` съответстват на дадения ред, програмата печата резултатите в stdout и спира.
177+
Ако протоколът, хостът и потребителското име от `known` съответстват на дадения ред, програмата печата резултатите в stdout и спира.
178178

179179
Ще запишем нашия helper като `git-credential-read-only`, ще го добавим към `PATH` променливата и ще го направим изпълним.
180180
Ето как изглежда интерактивната сесия:
@@ -184,6 +184,7 @@ include::../git-credential-read-only[]
184184
$ git credential-read-only --file=/mnt/shared/creds get
185185
protocol=https
186186
host=mygithost
187+
username=bob
187188
188189
protocol=https
189190
host=mygithost

0 commit comments

Comments
 (0)