Takajo Release Automation #19
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: Takajo Release Automation | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: 'v2.x.x' | |
required: true | |
release_name: | |
description: 'Release xxx' | |
required: true | |
release_ver: | |
description: '2.x.x' | |
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 | |
with: | |
nim-version: 2.0.2 | |
- name: Build Binary | |
run: | | |
nimble update | |
nimble build -d:release --threads:on | |
- name: Package and Zip | |
run: | | |
mkdir -p artifacts | |
cp takajo artifacts/ | |
cp mitre-attack.json artifacts/ | |
case ${{ matrix.os }} in | |
'windows-latest') zip -j artifacts/takajo-${{ github.event.inputs.version_number }}-win.zip artifacts/* ;; | |
'ubuntu-latest') zip -j artifacts/takajo-${{ github.event.inputs.version_number }}-linux.zip artifacts/* ;; | |
'macos-latest') zip -j artifacts/takajo-${{ github.event.inputs.version_number }}-mac.zip artifacts/* ;; | |
esac | |
- name: Create Release Draft | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.release_tag }} | |
release_name: ${{ github.event.inputs.release_name }} | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: release-artifact | |
path: artifacts/* |