-
Notifications
You must be signed in to change notification settings - Fork 90
91 lines (80 loc) · 2.5 KB
/
build-pdf.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
name: Build the RVV C intrinsics specification
on:
push:
branches:
- main
pull_request:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install packages
run: sudo apt-get update && sudo apt-get install -y make ruby
- name: Install gems
run: sudo gem install asciidoctor asciidoctor-pdf
- name: Build
run: make -C doc build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: v-intrinsic-spec.pdf
path: doc/v-intrinsic-spec.pdf
draft-release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: v-intrinsic-spec.pdf
path: ./doc/
- name: Get current date
id: date
run: echo "::set-output name=date::$(date -u +'%Y%m%d')"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: draft-${{ steps.date.outputs.date }}-${{ github.sha }}
release_name: Draft release ${{ steps.date.outputs.date }}
body: Latest snapshot (${{ github.sha }})
prerelease: true
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: doc/v-intrinsic-spec.pdf
asset_name: v-intrinsic-spec.pdf
asset_content_type: application/pdf
release:
if: github.event_name == 'release' && github.event.action == 'created'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: v-intrinsic-spec.pdf
path: ./doc
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: doc/v-intrinsic-spec.pdf
asset_name: v-intrinsic-spec.pdf
asset_content_type: application/pdf