Skip to content

Updated nuget packages and added gpt-4-turbo-preview to the model opt… #88

Updated nuget packages and added gpt-4-turbo-preview to the model opt…

Updated nuget packages and added gpt-4-turbo-preview to the model opt… #88

Workflow file for this run

name: Build and Release
permissions:
contents: write
packages: write
actions: write
deployments: write
on:
push:
tags:
- 'v*'
jobs:
build-and-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
artifact_name: GPT-CLI-win-x64
runtime: win-x64
- os: ubuntu-latest
artifact_name: GPT-CLI-linux-x64
runtime: linux-x64
- os: macos-latest
artifact_name: GPT-CLI-osx-x64
runtime: osx-x64
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Build and Publish
shell: bash
run: |
dotnet publish gpt.csproj -c Release -r ${{ matrix.runtime }} --self-contained true -p:PublishSingleFile=true -o build/${{ matrix.artifact_name }}
cd build/${{ matrix.artifact_name }}
ls -la *
if [[ -f "gpt.exe" ]]
then
7z a -tzip ${{ matrix.artifact_name }}.zip gpt.exe
elif [[ -f "gpt" ]]
then
7z a -tzip ${{ matrix.artifact_name }}.zip gpt
fi
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact_name }}.zip
path: build/${{ matrix.artifact_name }}/${{matrix.artifact_name}}.zip
create-release:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install GitHub CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
- name: Download artifacts
run: |
mkdir -p ./artifacts
gh run download --repo $GITHUB_REPOSITORY --name GPT-CLI-linux-x64.zip -D ./artifacts
gh run download --repo $GITHUB_REPOSITORY --name GPT-CLI-osx-x64.zip -D ./artifacts
gh run download --repo $GITHUB_REPOSITORY --name GPT-CLI-win-x64.zip -D ./artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List artifacts directory
run: |
ls -la ./artifacts
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets (win-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/GPT-CLI-win-x64.zip
asset_name: GPT-CLI-win-x64.zip
asset_content_type: application/zip
- name: Upload Release Assets (linux-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/GPT-CLI-linux-x64.zip
asset_name: GPT-CLI-linux-x64.zip
asset_content_type: application/zip
- name: Upload Release Assets (osx-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/GPT-CLI-osx-x64.zip
asset_name: GPT-CLI-osx-x64.zip
asset_content_type: application/zip