From f594b0c52736085ff034ad1b032b3860615d7590 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sat, 26 Jun 2021 21:41:52 -0600 Subject: [PATCH 01/21] Create ci.yml --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..5790c15e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake book:build From b8fedcb050f6c6345308fc91924d8f5c378dd4bc Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sat, 26 Jun 2021 21:58:09 -0600 Subject: [PATCH 02/21] Create tag-on-merge.yml --- .github/workflows/tag-on-merge.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/tag-on-merge.yml diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml new file mode 100644 index 000000000..901996cb0 --- /dev/null +++ b/.github/workflows/tag-on-merge.yml @@ -0,0 +1,22 @@ +name: Tag on merge to master + +on: + push: + branches: [ master ] + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Compute tag name + id: compute-tag + run: | + echo Computing next tag number + LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) + echo "::set-output name=tagname::$(($LASTPATCH+1))" + - name: Create Tag + uses: negz/create-tag@v1 + with: + version: ${{ steps.compute-tag.outputs.tagname }} + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From ab68c8f0dca757e76684ccd1f6546a67b69635bf Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 06:42:04 -0600 Subject: [PATCH 03/21] Add release-on-tag workflow --- .github/workflows/ci.yml | 2 +- .github/workflows/release-on-tag.yml | 30 ++++++++++++++++++++++++++++ .github/workflows/tag-on-merge.yml | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-on-tag.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5790c15e5..dbc04f536 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,5 +16,5 @@ jobs: with: ruby-version: 2.7 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run tests + - name: Run build run: bundle exec rake book:build diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml new file mode 100644 index 000000000..c8efa2add --- /dev/null +++ b/.github/workflows/release-on-tag.yml @@ -0,0 +1,30 @@ +name: Tag on merge to master + +on: + push: + tags: [ '*' ] + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run build + run: bundle exec rake book:build + + - name: Grab tag name + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Create release + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ env.RELEASE_VERSION }} + artifacts: './progit.epub,./progit.mobi,./progit.pdf,./progit.html' diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index 901996cb0..651e0ec7e 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -9,12 +9,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Compute tag name id: compute-tag run: | echo Computing next tag number LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) echo "::set-output name=tagname::$(($LASTPATCH+1))" + - name: Create Tag uses: negz/create-tag@v1 with: From b0bbdb3ac58abae93b3522a54a256b5f8b154404 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 06:46:53 -0600 Subject: [PATCH 04/21] Adjust whitespace --- .github/workflows/release-on-tag.yml | 4 ++-- .github/workflows/tag-on-merge.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index c8efa2add..a7349efd1 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -15,13 +15,13 @@ jobs: with: ruby-version: 2.7 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - + - name: Run build run: bundle exec rake book:build - name: Grab tag name run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - + - name: Create release uses: ncipollo/release-action@v1 with: diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index 651e0ec7e..fb2ddfa71 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -16,9 +16,9 @@ jobs: echo Computing next tag number LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) echo "::set-output name=tagname::$(($LASTPATCH+1))" - + - name: Create Tag uses: negz/create-tag@v1 with: version: ${{ steps.compute-tag.outputs.tagname }} - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} From 41abef539094ee0bce1f3cfd1a0333be201760b9 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 06:48:23 -0600 Subject: [PATCH 05/21] Names are hard --- .github/workflows/ci.yml | 4 +++- .github/workflows/release-on-tag.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbc04f536..5628e6a15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run build + + - name: Build book run: bundle exec rake book:build diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index a7349efd1..30914511e 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -16,7 +16,7 @@ jobs: ruby-version: 2.7 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run build + - name: Build book run: bundle exec rake book:build - name: Grab tag name From d6e24367cdce2f3f18c669fa88f9057da2554061 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 06:51:12 -0600 Subject: [PATCH 06/21] Tags should be 2.1.xxx --- .github/workflows/tag-on-merge.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index fb2ddfa71..51b6dc094 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -15,7 +15,8 @@ jobs: run: | echo Computing next tag number LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) - echo "::set-output name=tagname::$(($LASTPATCH+1))" + PATCH=$(($LASTPATCH+1)) + echo "::set-output name=tagname::2.1.${PATCH})" - name: Create Tag uses: negz/create-tag@v1 From 4ddfc991305f7f1f1583b127eae7d1bb284ee23a Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 08:35:17 -0600 Subject: [PATCH 07/21] Names are still hard --- .github/workflows/{ci.yml => pr-build.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{ci.yml => pr-build.yml} (94%) diff --git a/.github/workflows/ci.yml b/.github/workflows/pr-build.yml similarity index 94% rename from .github/workflows/ci.yml rename to .github/workflows/pr-build.yml index 5628e6a15..e94bb222d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/pr-build.yml @@ -1,4 +1,4 @@ -name: CI +name: Pull Request Build on: push: From 331e79433ee108751b3c35b42cbfc2f30959a143 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 08:35:30 -0600 Subject: [PATCH 08/21] Only run on PRs --- .github/workflows/pr-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e94bb222d..592c3f214 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,8 +1,6 @@ name: Pull Request Build on: - push: - branches: [ master ] pull_request: branches: [ master ] From f84882cab0ee3f4875864abd89b7680fa65937b5 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 08:36:03 -0600 Subject: [PATCH 09/21] Yup, names are still hard --- .github/workflows/release-on-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 30914511e..654059a53 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -1,4 +1,4 @@ -name: Tag on merge to master +name: Release on tag on: push: From 8c6ae5bc67980c2747cdc0aed5699a95c63246e5 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 08:36:34 -0600 Subject: [PATCH 10/21] Update .github/workflows/tag-on-merge.yml Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- .github/workflows/tag-on-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index 51b6dc094..4d33f04b0 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -18,7 +18,7 @@ jobs: PATCH=$(($LASTPATCH+1)) echo "::set-output name=tagname::2.1.${PATCH})" - - name: Create Tag + - name: Create tag uses: negz/create-tag@v1 with: version: ${{ steps.compute-tag.outputs.tagname }} From c347bccfa4c354f5623296089f449c09247f3b10 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 08:53:53 -0600 Subject: [PATCH 11/21] A different tagging action --- .github/workflows/tag-on-merge.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index 4d33f04b0..8678812bb 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -18,8 +18,14 @@ jobs: PATCH=$(($LASTPATCH+1)) echo "::set-output name=tagname::2.1.${PATCH})" - - name: Create tag - uses: negz/create-tag@v1 + - name: Create Tag + uses: actions/github-script@v3 with: - version: ${{ steps.compute-tag.outputs.tagname }} - token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ github.token }} + script: | + github.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: "refs/tags/${{ steps.compute-tag.outputs.tagname }}", + sha: context.sha + }) From ca8a4293bfe7cf087ec830c770d5493b623d86d4 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 08:55:14 -0600 Subject: [PATCH 12/21] wups --- .github/workflows/tag-on-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index 8678812bb..c0669240c 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -16,7 +16,7 @@ jobs: echo Computing next tag number LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) PATCH=$(($LASTPATCH+1)) - echo "::set-output name=tagname::2.1.${PATCH})" + echo "::set-output name=tagname::2.1.${PATCH}" - name: Create Tag uses: actions/github-script@v3 From 223491938747adaa002164eb32c9f67df82b144d Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 27 Jun 2021 09:06:27 -0600 Subject: [PATCH 13/21] We'll be needing all of these --- .github/workflows/tag-on-merge.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml index c0669240c..768d10e81 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/tag-on-merge.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Compute tag name id: compute-tag From 8932eb6d358acc21ee1f4694da42f9cb492ab8b2 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 06:20:11 -0700 Subject: [PATCH 14/21] Move release-generation into push-to-master workflow --- ...{tag-on-merge.yml => release-on-merge.yml} | 7 +++++ .github/workflows/release-on-tag.yml | 30 ------------------- 2 files changed, 7 insertions(+), 30 deletions(-) rename .github/workflows/{tag-on-merge.yml => release-on-merge.yml} (75%) delete mode 100644 .github/workflows/release-on-tag.yml diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/release-on-merge.yml similarity index 75% rename from .github/workflows/tag-on-merge.yml rename to .github/workflows/release-on-merge.yml index 768d10e81..af2a32eb3 100644 --- a/.github/workflows/tag-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -31,3 +31,10 @@ jobs: ref: "refs/tags/${{ steps.compute-tag.outputs.tagname }}", sha: context.sha }) + + - name: Create release + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ steps.compute-tag.outputs.tagname }} + artifacts: './progit.epub,./progit.mobi,./progit.pdf,./progit.html' diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml deleted file mode 100644 index 654059a53..000000000 --- a/.github/workflows/release-on-tag.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release on tag - -on: - push: - tags: [ '*' ] - -jobs: - tag: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - - name: Build book - run: bundle exec rake book:build - - - name: Grab tag name - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Create release - uses: ncipollo/release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: ${{ env.RELEASE_VERSION }} - artifacts: './progit.epub,./progit.mobi,./progit.pdf,./progit.html' From cca8c1f17f3bbaee73559b97e5f4a177e19480e4 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 06:21:01 -0700 Subject: [PATCH 15/21] namesssss --- .github/workflows/release-on-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index af2a32eb3..016d0733a 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -1,4 +1,4 @@ -name: Tag on merge to master +name: Release on push to master on: push: From a360becbb94766397fe69bfc65772b5ab08fedc7 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 06:22:29 -0700 Subject: [PATCH 16/21] Let's try this --- .github/workflows/release-on-merge.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index 016d0733a..4e305c1b3 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -5,7 +5,7 @@ on: branches: [ master ] jobs: - tag: + release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -21,16 +21,9 @@ jobs: echo "::set-output name=tagname::2.1.${PATCH}" - name: Create Tag - uses: actions/github-script@v3 - with: - github-token: ${{ github.token }} - script: | - github.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "refs/tags/${{ steps.compute-tag.outputs.tagname }}", - sha: context.sha - }) + run: | + git tag ${{ steps.compute-tag.outputs.tagname }} + git push origin ${{ steps.compute-tag.outputs.tagname }} - name: Create release uses: ncipollo/release-action@v1 From a1296a6810b918a02ee7a7606052d71133fcc79b Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 06:32:27 -0700 Subject: [PATCH 17/21] Wait this action can create tags too --- .github/workflows/release-on-merge.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index 4e305c1b3..b8a43efe7 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -20,14 +20,10 @@ jobs: PATCH=$(($LASTPATCH+1)) echo "::set-output name=tagname::2.1.${PATCH}" - - name: Create Tag - run: | - git tag ${{ steps.compute-tag.outputs.tagname }} - git push origin ${{ steps.compute-tag.outputs.tagname }} - - name: Create release uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - name: ${{ steps.compute-tag.outputs.tagname }} + tag: ${{ steps.compute-tag.outputs.tagname }} + commit: master artifacts: './progit.epub,./progit.mobi,./progit.pdf,./progit.html' From 68d21bca89052a59db2e485bd27e76bb771587cd Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 06:33:56 -0700 Subject: [PATCH 18/21] duh --- .github/workflows/release-on-merge.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index b8a43efe7..1496f42b1 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -20,6 +20,15 @@ jobs: PATCH=$(($LASTPATCH+1)) echo "::set-output name=tagname::2.1.${PATCH}" + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Build release assets + run: bundle exec rake book:build + - name: Create release uses: ncipollo/release-action@v1 with: From 692c7a040989ceda96fbe30fa9101cc5ad807f7b Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 07:59:26 -0700 Subject: [PATCH 19/21] Remove now-unused files --- .travis.yml | 34 ---------------------------------- script/tag_on_master | 19 ------------------- 2 files changed, 53 deletions(-) delete mode 100644 .travis.yml delete mode 100755 script/tag_on_master diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c28bea168..000000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: ruby -git: - depth: false -cache: bundler -before_install: -- bundle install -after_success: -- script/tag_on_master -script: bundle exec rake book:build -env: - secure: "O+YCTDgLfCYAJjjOv2sApDRV5NJe6pkhiYIkORFuf2flO8HE72fEtDRpSWh1vulnIH6AjRK2jH7C8qA3MVbUO8D0io+Ha+vnbMXIp1JPCptcJNEkJrW13VTR66SWOzsgLp3mCrIC+YdE2JoYWGcnDsRMQwdnrWnxBzSOd22ZKzU=" - -before_deploy: bundle install && bundle exec rake book:build -deploy: - provider: releases - file: - - progit.epub - - progit.mobi - - progit.pdf - - progit.html - skip_cleanup: true - on: - tags: true - api-key: - secure: "l3XdupX6dT48IoTieJXrd7Yx8+KhiR2QYrNrDzT6RKxA7UyXGSP/axsVerg7OjKfIHWZgDJRVzcc2RswE+Xjw9sOY8r2h2q9uCwj8G0EqtFbtgGK0La5LB0euh0tNJN8GLFj1OdSZGY7dWWK88GXeHCua2WSify0V79R4ClIM+s=" -branches: - only: - - master - - /^2\.1(\.\d+)+$/ - -notifications: - email: - on_success: never - on_failure: always diff --git a/script/tag_on_master b/script/tag_on_master deleted file mode 100755 index 6757a2997..000000000 --- a/script/tag_on_master +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# This is for running on Travis. It automatically tags any merge to Master as a release in the 2.1.x series. -if [[ $TRAVIS_PULL_REQUEST != 'false' || "$TRAVIS_BRANCH" != 'master' ]]; then - # Don't run on pull requests - echo 'This only runs on a merge to master.' - exit 0 -fi - -# Compute the next tag number -LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) -PATCH=$(($LASTPATCH+1)) -echo $PATCH - -# Create a tag -curl -H "Authorization: token $GITHUB_KEY" \ - -X POST \ - -d "{\"ref\":\"refs/tags/2.1.$PATCH\", \"sha\":\"$TRAVIS_COMMIT\"}" \ - https://api.github.com/repos/progit/progit2/git/refs From 63129f6e982c649f6e9de003bc2b9260edceaee3 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 07:59:34 -0700 Subject: [PATCH 20/21] Clean up documentation --- Rakefile | 2 +- TRANSLATING.md | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Rakefile b/Rakefile index e9446dbc5..0b0fd661f 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,7 @@ namespace :book do end # Variables referenced for build - version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp + version_string = `git describe --tags`.chomp if version_string.empty? version_string = '0' end diff --git a/TRANSLATING.md b/TRANSLATING.md index bc25e3688..78ac783b9 100644 --- a/TRANSLATING.md +++ b/TRANSLATING.md @@ -72,22 +72,11 @@ On https://git-scm.com, the translations are divided into three categories. Once | Partial translations available in | up to chapter 6 has been translated. | | Full translation available in |the book is (almost) fully translated. | -## Continuous integration with Travis CI +## Continuous integration with GitHub Actions -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. +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. -Setting up Travis CI requires administrative control over the repository. - -### Registering for Travis continuous integration - -1. Register a Travis account [here](https://travis-ci.org/). -1. Register your project in Travis. -Please refer to the [Travis documentation](https://docs.travis-ci.com/) for more information. - -### Setting up your repository for continuous integration - -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). -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. +If you keep the `.github` directory from the root repository, you should get the GitHub Action CI setup for free. ## Setting up a publication chain for e-books From a72f948f671ae798bcfdbb50aa1e3d39580aef79 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 28 Jun 2021 08:13:05 -0700 Subject: [PATCH 21/21] Accuracy --- TRANSLATING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TRANSLATING.md b/TRANSLATING.md index 78ac783b9..67985e4d5 100644 --- a/TRANSLATING.md +++ b/TRANSLATING.md @@ -76,7 +76,9 @@ On https://git-scm.com, the translations are divided into three categories. Once 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. -If you keep the `.github` directory from the root repository, you should get the GitHub Action CI setup for free. +The configuration for GitHub Actions is contained in the `.github/workflows` directory, and if you bring in the `master` branch of the root repository you'll get them for free. +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). +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. ## Setting up a publication chain for e-books