Takajo Release Automation #28
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_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/windows-takajo-${{ github.event.inputs.version_number }}.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: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-artifact | |
path: artifacts/* |