feat: Update Node.js version in GitHub Actions workflow to 20.x #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 20.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 |