👷 update ci system
This commit is contained in:
parent
1986f19c24
commit
186fe73756
3 changed files with 68 additions and 70 deletions
36
.github/workflows/ci.yaml
vendored
Normal file
36
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install V
|
||||||
|
uses: vlang/setup-v@v1
|
||||||
|
with:
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Install Task
|
||||||
|
uses: arduino/setup-task@v1
|
||||||
|
|
||||||
|
- name: Checkout ${{ github.event.repository.name }}
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Check if code is formatted
|
||||||
|
run: |
|
||||||
|
v fmt -diff .
|
||||||
|
v fmt -verify .
|
||||||
|
- name: Build ${{ github.event.repository.name }}
|
||||||
|
run: v .
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: v test .
|
90
.github/workflows/release.yaml
vendored
90
.github/workflows/release.yaml
vendored
|
@ -3,81 +3,33 @@ name: release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- "v*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Release-on-Ubuntu:
|
build:
|
||||||
name: Release on Ubuntu
|
strategy:
|
||||||
runs-on: ubuntu-latest
|
matrix:
|
||||||
|
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Install V
|
||||||
- uses: denoland/setup-deno@v1
|
uses: vlang/setup-v@v1
|
||||||
with:
|
with:
|
||||||
deno-version: v1.x
|
check-latest: true
|
||||||
- uses: goto-bus-stop/setup-zig@v1
|
|
||||||
with:
|
- name: Install Task
|
||||||
version: 0.9.1
|
uses: arduino/setup-task@v1
|
||||||
- name: make x86_64
|
|
||||||
run: make dist
|
- name: Checkout ${{ github.event.repository.name }}
|
||||||
- name: make aarch64
|
uses: actions/checkout@v2
|
||||||
run: ./misc/build-aarch64.sh
|
|
||||||
|
- name: Build ${{ github.event.repository.name }}
|
||||||
|
run: task dist
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, "refs/tags/")
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
dist/**
|
dist/**
|
||||||
|
|
||||||
Release-on-Darwin:
|
|
||||||
name: Release on Darwin
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: denoland/setup-deno@v1
|
|
||||||
with:
|
|
||||||
deno-version: v1.x
|
|
||||||
- uses: goto-bus-stop/setup-zig@v1
|
|
||||||
with:
|
|
||||||
version: 0.9.1
|
|
||||||
- name: make x86_64
|
|
||||||
run: make dist
|
|
||||||
- name: make aarch64
|
|
||||||
run: ./misc/build-aarch64.sh
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
dist/**
|
|
||||||
|
|
||||||
Release-on-Windows:
|
|
||||||
name: Release on Windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: denoland/setup-deno@v1
|
|
||||||
with:
|
|
||||||
deno-version: v1.x
|
|
||||||
#- uses: goto-bus-stop/setup-zig@v1
|
|
||||||
# with:
|
|
||||||
# version: 0.9.1
|
|
||||||
- uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
update: true
|
|
||||||
install: mingw-w64-x86_64-toolchain
|
|
||||||
msystem: MINGW64
|
|
||||||
path-type: inherit
|
|
||||||
- name: make x86_64
|
|
||||||
shell: msys2 {0}
|
|
||||||
run: |
|
|
||||||
mingw32-make dist
|
|
||||||
#- name: make aarch64
|
|
||||||
# shell: msys2 {0}
|
|
||||||
# run: |
|
|
||||||
# mingw32-make ARCH=aarch64 CC="zig cc -target aarch64-windows"
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
dist/**
|
|
12
Taskfile.yml
12
Taskfile.yml
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
|
env:
|
||||||
|
TARGET: vss
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
|
@ -30,10 +33,17 @@ tasks:
|
||||||
cmds:
|
cmds:
|
||||||
- rm -rf dist/
|
- rm -rf dist/
|
||||||
|
|
||||||
|
dist:
|
||||||
|
desc: Mkdir dist
|
||||||
|
cmds:
|
||||||
|
- mkdir -p dist
|
||||||
|
- task: build
|
||||||
|
- cp $TARGET dist/
|
||||||
|
|
||||||
build:
|
build:
|
||||||
desc: Build vss
|
desc: Build vss
|
||||||
cmds:
|
cmds:
|
||||||
- v .
|
- v . -o $TARGET
|
||||||
|
|
||||||
example:
|
example:
|
||||||
desc: Setup for example
|
desc: Setup for example
|
||||||
|
|
Loading…
Add table
Reference in a new issue