Update release.yml #30
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: Nim Build and Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Tag version' | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.event.inputs.version }} | |
release_name: Release v${{ github.event.inputs.version }} | |
draft: false | |
prerelease: false | |
- run: echo "release-url=${{ steps.create_release.outputs.upload_url }}" >> "$GITHUB_ENV" | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Nim | |
uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: '1.6.10' | |
- name: Install reqs | |
run: nimble install -y | |
- name: extension | |
env: | |
out-ext: ${{ matrix.os == 'windows-latest' && '.exe' || '.sh' }} | |
- name: Build | |
id: build | |
run: | | |
nim compile --define:release --outdir:. --out:DitakticTei${{ env.out-ext }} src/tei.nim | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ env.release-url }} | |
asset_path: ./DitakticTei${{ env.out-ext }} | |
asset_name: DitakticTei${{ env.out-ext }} | |
asset_content_type: application/octet-stream |