👷 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 .
|
86
.github/workflows/release.yaml
vendored
86
.github/workflows/release.yaml
vendored
|
@ -3,81 +3,33 @@ name: release
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*.*.*"
|
||||
|
||||
jobs:
|
||||
Release-on-Ubuntu:
|
||||
name: Release on Ubuntu
|
||||
runs-on: ubuntu-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/**
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
Release-on-Darwin:
|
||||
name: Release on Darwin
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: denoland/setup-deno@v1
|
||||
- name: Install V
|
||||
uses: vlang/setup-v@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/**
|
||||
check-latest: true
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
|
||||
- name: Checkout ${{ github.event.repository.name }}
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build ${{ github.event.repository.name }}
|
||||
run: task 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/')
|
||||
if: startsWith(github.ref, "refs/tags/")
|
||||
with:
|
||||
files: |
|
||||
dist/**
|
12
Taskfile.yml
12
Taskfile.yml
|
@ -2,6 +2,9 @@
|
|||
|
||||
version: '3'
|
||||
|
||||
env:
|
||||
TARGET: vss
|
||||
|
||||
tasks:
|
||||
|
||||
doc:
|
||||
|
@ -30,10 +33,17 @@ tasks:
|
|||
cmds:
|
||||
- rm -rf dist/
|
||||
|
||||
dist:
|
||||
desc: Mkdir dist
|
||||
cmds:
|
||||
- mkdir -p dist
|
||||
- task: build
|
||||
- cp $TARGET dist/
|
||||
|
||||
build:
|
||||
desc: Build vss
|
||||
cmds:
|
||||
- v .
|
||||
- v . -o $TARGET
|
||||
|
||||
example:
|
||||
desc: Setup for example
|
||||
|
|
Loading…
Add table
Reference in a new issue