-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 1.99 KB
/
create-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
name: Convert Markdown to PDF and Create release
on:
push:
tags: 'v*'
env:
ASSET_NAME_JA: cv__Shogo_Kusuhara--JA.pdf
ASSET_NAME_EN: cv__Shogo_Kusuhara--EN.pdf
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get the git tag version
id: tag_version
run: |
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/}
- name: Get font
run: |
sudo apt install fonts-noto
- name: Convert Markdown to PDF
run: |
yarn add md-to-pdf
export LANG=ja_JP.UTF-8
npx md-to-pdf README.md
export LANG=en_US.UTF-8
npx md-to-pdf README.en.md
- name: Rename generated PDF
run: |
cp README.pdf ${{ env.ASSET_NAME_JA }}
cp README.en.pdf ${{ env.ASSET_NAME_EN }}
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.tag_version.outputs.TAG_VERSION}}
release_name: ${{steps.tag_version.outputs.TAG_VERSION}}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset-ja
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.ASSET_NAME_JA }}
asset_name: ${{ env.ASSET_NAME_JA }}
asset_content_type: application/pdf
- name: Upload Release Asset
id: upload-release-asset-en
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.ASSET_NAME_EN }}
asset_name: ${{ env.ASSET_NAME_EN }}
asset_content_type: application/pdf