Skip to content

Commit 338d0cc

Browse files
authored
Add release workflow
1 parent edac2eb commit 338d0cc

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)