chore: change ubuntu build for push action (#17) #95
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: CI | |
on: | |
push: | |
tags: ["v[0-9]+.[0-9]+.[0-9]+"] | |
paths: | |
[ | |
".github/scripts/**", | |
".github/workflows/build.yml", | |
"**/CMakeLists.txt", | |
"**/Makefile", | |
"**/*.h", | |
"**/*.hpp", | |
"**/*.c", | |
"**/*.cpp", | |
"**/*.cu", | |
"**/*.cc", | |
"**/*.cxx", | |
"llama.cpp", | |
"!docs/**", | |
"!.gitignore", | |
"!README.md", | |
] | |
workflow_dispatch: | |
jobs: | |
create-draft-release: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
version: ${{ steps.get_version.outputs.version }} | |
permissions: | |
contents: write | |
steps: | |
- name: Extract tag name without v prefix | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}" | |
env: | |
GITHUB_REF: ${{ github.ref }} | |
- name: Create Draft Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: "${{ env.VERSION }}" | |
draft: true | |
prerelease: false | |
build-and-test: | |
runs-on: ${{ matrix.runs-on }} | |
needs: [create-draft-release] | |
timeout-minutes: 40 | |
strategy: | |
matrix: | |
include: | |
# - os: "linux" | |
# name: "amd64" | |
# runs-on: "ubuntu-18-04" | |
- os: "linux" | |
name: "amd64" | |
runs-on: "ubuntu-latest" | |
- os: "mac" | |
name: "arm64" | |
runs-on: "mac-silicon" | |
- os: "mac" | |
name: "amd64" | |
runs-on: "macos-13" | |
# - os: "windows" | |
# name: "amd64" | |
# runs-on: "windows-cuda-12-0" | |
- os: "windows" | |
name: "amd64" | |
runs-on: "windows-latest" | |
steps: | |
- name: Clone | |
id: checkout | |
uses: actions/checkout@v3 | |
- name: Install OpenSSL on Ubuntu | |
if: matrix.os == 'linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y openssl libssl-dev | |
- name: Install make on Windows | |
if: runner.os == 'windows' | |
run: | | |
choco install make -y | |
- name: Install dependencies | |
run: | | |
make install-dependencies | |
- name: Build engine | |
run: | | |
make build-engine | |
- name: Build example server | |
run: | | |
make build-example-server | |
- name: Run e2e test | |
run: | | |
make run-e2e-test | |
- name: Package | |
run: | | |
make package | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cortex.python-${{ matrix.os }}-${{ matrix.name }} | |
path: ./cortex.python.tar.gz | |
- uses: actions/[email protected] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-draft-release.outputs.upload_url }} | |
asset_path: ./cortex.python.tar.gz | |
asset_name: cortex.python-${{ needs.create-draft-release.outputs.version }}-${{ matrix.os }}-${{ matrix.name }}.tar.gz | |
asset_content_type: application/gzip |