workflow for releasing AI proxy #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: Release AI proxy spin app | |
on: | |
workflow_dispatch: # Manual trigger | |
pull_request: | |
branches: [ main ] | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
name: "Build and test AI proxy" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash | |
sudo mv spin /usr/local/bin/ | |
rustup target add wasm32-wasi | |
cargo install cargo-component --locked | |
spin plugin install -y -u https://github.com/fermyon/spin-test/releases/download/canary/spin-test.json | |
- name: Check formatting | |
working-directory: examples/aiproxy | |
run: | | |
(cd openai-proxy && cargo fmt --check) | |
(cd tests && cargo fmt --check) | |
- name: Build project | |
working-directory: examples/aiproxy | |
run: | | |
spin build | |
- name: Run tests | |
working-directory: examples/aiproxy | |
run: | | |
spin test | |
release: | |
name: "Release" | |
needs: build | |
runs-on: ubuntu-latest | |
# if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Push to registry | |
run: | | |
spin registry push ghcr.io/${{ github.repository_owner }}//near-ft-openai-proxy:${{ github.ref }} |