Skip to content

Takajo Release Automation #34

Takajo Release Automation

Takajo Release Automation #34

Workflow file for this run

name: Takajo Release Automation
on:
workflow_dispatch:
inputs:
release_ver:
required: true
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Nim
uses: jiro4989/setup-nim-action@v1
- name: Build Binary
run: |
nimble update
nimble build -d:release --threads:on
- name: Package and Zip - Windows
if: matrix.os == 'windows-latest'
run: |
mkdir -p artifacts
Copy-Item -Path takajo.exe -Destination artifacts/
Copy-Item -Path mitre-attack.json -Destination artifacts/
Compress-Archive -Path artifacts/* -DestinationPath artifacts/takajo-${{ github.event.inputs.release_ver }}-win.zip -Force
- name: Package and Zip - Unix
if: matrix.os != 'windows-latest'
run: |
mkdir -p artifacts
cp takajo artifacts/
cp mitre-attack.json artifacts/
case ${{ matrix.os }} in
'ubuntu-latest') zip -j artifacts/takajo-${{ github.event.inputs.release_ver }}-linux.zip artifacts/* ;;
'macos-latest') zip -j artifacts/takajo-${{ github.event.inputs.release_ver }}-mac.zip artifacts/* ;;
esac
- name: Create PDF
if: matrix.os == 'ubuntu-latest'
uses: baileyjm02/markdown-to-pdf@v1
with:
input_path: ./
output_dir: pdfs
build_html: false
- name: Rename PDF
if: matrix.os == 'ubuntu-latest'
run: |
mv README.pdf README-${{ github.event.inputs.release_ver }}-English.pdf
mv README-Japanese.pdf README-${{ github.event.inputs.release_ver }}-Japanese.pdf
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: release-artifact
path: |
artifacts/*
pdfs/*