Skip to content

Commit f82ff99

Browse files
committed
Use workflows from templates
1 parent 77971fe commit f82ff99

File tree

3 files changed

+64
-89
lines changed

3 files changed

+64
-89
lines changed

.github/workflows/pr-build.yml

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

.github/workflows/ruby.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)