added nim.cfg #2
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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Triggers the workflow on version tags | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Nim | |
uses: appleboy/nim-action@v1 | |
with: | |
nim-version: 2.0.4 | |
- name: Install Nimble | |
run: nimble install -y | |
- name: Build the program | |
run: nimble build -y | |
- name: Archive the build (Linux and macOS) | |
if: matrix.os != 'windows-latest' | |
run: tar -czvf ${{ runner.os }}-build.tar.gz mygitignore | |
- name: Archive the build (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
mkdir archive | |
move mygitignore.exe archive\ | |
tar -czvf windows-build.tar.gz archive | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }}-build | |
path: | | |
${{ runner.os }}-build.tar.gz | |
release: | |
name: Create GitHub Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: | | |
ubuntu-latest-build | |
macos-latest-build | |
windows-latest-build | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
ubuntu-latest-build.tar.gz | |
macos-latest-build.tar.gz | |
windows-latest-build.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |