forked from riscv/riscv-isa-manual
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (92 loc) · 3.74 KB
/
merge-and-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release New ISA When Merging a PR
on:
pull_request:
branches:
- main
types:
- closed
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
echo The PR was successfully merged.
- name: Set short SHA
run: echo "SHORT_SHA=$(echo ${GITHUB_SHA::7})" >> $GITHUB_ENV
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Pull Container
id: pull_container_image
run: |
docker pull riscvintl/riscv-docs-base-container-image:latest
- name: Build Files
id: build_files
if: steps.pull_container_image.outcome == 'success'
run: |
docker run --rm -v ${{ github.workspace }}:/build riscvintl/riscv-docs-base-container-image:latest \
/bin/sh -c 'export LANG=C.utf8; cd ./build && make'
# Upload the priv-isa-asciidoc PDF file
- name: Upload priv-isa-asciidoc.pdf
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: priv-isa-asciidoc-${{ env.SHORT_SHA }}.pdf
path: ${{ github.workspace }}/build/priv-isa-asciidoc.pdf
# Upload the priv-isa-asciidoc HTML file
- name: Upload priv-isa-asciidoc.html
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: priv-isa-asciidoc-${{ env.SHORT_SHA }}.html
path: ${{ github.workspace }}/build/priv-isa-asciidoc.html
# Upload the priv-isa-asciidoc EPUB file
- name: Upload priv-isa-asciidoc.epub
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: priv-isa-asciidoc-${{ env.SHORT_SHA }}.epub
path: ${{ github.workspace }}/build/priv-isa-asciidoc.epub
# Upload the unpriv-isa-asciidoc PDF file
- name: Upload unpriv-isa-asciidoc.pdf
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: unpriv-isa-asciidoc-${{ env.SHORT_SHA }}.pdf
path: ${{ github.workspace }}/build/unpriv-isa-asciidoc.pdf
# Upload the unpriv-isa-asciidoc HTML file
- name: Upload unpriv-isa-asciidoc.html
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: unpriv-isa-asciidoc-${{ env.SHORT_SHA }}.html
path: ${{ github.workspace }}/build/unpriv-isa-asciidoc.html
# Upload the unpriv-isa-asciidoc EPUB file
- name: Upload unpriv-isa-asciidoc.epub
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: unpriv-isa-asciidoc-${{ env.SHORT_SHA }}.epub
path: ${{ github.workspace }}/build/unpriv-isa-asciidoc.epub
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
with:
tag_name: riscv-isa-release-${{ env.SHORT_SHA }}-${{ env.CURRENT_DATE }}
name: Release riscv-isa-release-${{ env.SHORT_SHA }}-${{ env.CURRENT_DATE }}
draft: false
prerelease: false
make_latest: true
generate_release_notes: true
body: |
This release was created by: ${{ github.event.sender.login }}
Release of RISC-V ISA, built from commit ${{ env.SHORT_SHA }}, is now available.
files: |
${{ github.workspace }}/build/priv-isa-asciidoc.pdf
${{ github.workspace }}/build/priv-isa-asciidoc.html
${{ github.workspace }}/build/priv-isa-asciidoc.epub
${{ github.workspace }}/build/unpriv-isa-asciidoc.pdf
${{ github.workspace }}/build/unpriv-isa-asciidoc.html
${{ github.workspace }}/build/unpriv-isa-asciidoc.epub