[chore] testament #35
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: Release packages | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Cache Nim resources | |
id: cache_nim | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.choosenim | |
~/.nimble | |
key: nimcaches--${{ matrix.vm }} | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: 1.6.x | |
- name: Test Nim | |
run: | | |
testament --verbose --colors:off pattern 'tests/*.nim' | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create release on GitHub | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
body: If you want, please see [tests](https://github.com/u1and0/jtr/blob/master/tests) | |
draft: false | |
prerelease: false | |
build: | |
runs-on: ${{ matrix.vm }} | |
needs: test | |
strategy: | |
matrix: | |
include: | |
- name: linux | |
vm: ubuntu-latest | |
- name: macosx | |
vm: macos-latest | |
- name: windows | |
vm: windows-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Cache Nim resources | |
id: cache_nim | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.choosenim | |
~/.nimble | |
key: nimcaches--${{ matrix.vm }} | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: 2.0.x | |
- name: Build binary | |
run: nimble build -d:release --verbose | |
- name: Upload zip (Unix, MacOS) | |
if: runner.os != 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jtr-${{ matrix.name }} | |
path: jtr | |
- name: Upload zip (Windows) | |
if: runner.os == 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jtr-${{ matrix.name }} | |
path: jtr.exe |