Skip to content

chore: updated upload-artifact version #200

chore: updated upload-artifact version

chore: updated upload-artifact version #200

Workflow file for this run

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: aihub
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCS_IMAGE_NAME: aihub-prepdocs
PLUGIN_IMAGE_NAME: aihub-plugin
FSIPLUGIN_IMAGE_NAME: aihub-fsiplugin
AIHUB_ARTIFACT_NAME: aihub-tf-module
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.x'
include-prerelease: true
- name: Setup MinVer
run: |
dotnet tool install --global minver-cli --version 4.3.0
- name: Calculate Version
run: |
echo "MINVERVERSIONOVERRIDE=$($HOME/.dotnet/tools/minver -t v. -m 1.0 -p preview)" >> $GITHUB_ENV
- name: Build with dotnet
run: dotnet build --configuration Release
working-directory: './src/AIHub'
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
working-directory: './src/AIHub'
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp
- name: Login to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Lower case REPO
run: |
echo "GITHUB_REPOSITORY_LOWER_CASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push Docker image for AIHub
uses: docker/build-push-action@v3
with:
context: ./src/AIHub/
file: ./src/AIHub/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/aihub:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta.outputs.labels }}
build-args: MINVERVERSIONOVERRIDE=${{ env.MINVERVERSIONOVERRIDE }}
- name: Extract metadata (tags, labels) for prep-docs Docker
id: meta-docs
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.DOCS_IMAGE_NAME }}
- name: Build and push Docker image for prep-docs
uses: docker/build-push-action@v3
with:
context: ./src/prepdocs/
file: ./src/prepdocs/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/${{ env.DOCS_IMAGE_NAME }}:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta-docs.outputs.labels }}
- name: Extract metadata (tags, labels) for plugin Docker
id: meta-plugin
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.PLUGIN_IMAGE_NAME }}
- name: Build and push Docker image for plugin
uses: docker/build-push-action@v3
with:
context: ./src/OpenAI.Plugin/
file: ./src/OpenAI.Plugin/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/${{ env.PLUGIN_IMAGE_NAME }}:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta-plugin.outputs.labels }}
# FSI PLUGIN
- name: Extract metadata (tags, labels) for fsi plugin Docker
id: meta-fsiplugin
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.FSIPLUGIN_IMAGE_NAME }}
- name: Build and push Docker image for fsi plugin
uses: docker/build-push-action@v3
with:
context: ./src/OpenAI.Plugin.FSI/
file: ./src/OpenAI.Plugin.FSI/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/${{ env.FSIPLUGIN_IMAGE_NAME }}:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta-fsiplugin.outputs.labels }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.AIHUB_ARTIFACT_NAME }}
path: |
./infra/modules/
./infra/*.tf
./infra/*.md
release:
name: Create Release
needs: build
if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions: write-all
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: release
uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.MINVERVERSIONOVERRIDE }}
body: ${{ steps.changelog.outputs.clean_changelog }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ github.token }}
publish:
name: Publish binaries
needs: release
permissions: write-all
if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v')
env:
ARTIFACT_DIR: ${{ github.workspace }}/release
PROJECT_NAME: aihub
runs-on: ubuntu-latest
steps:
- name: download artifacts - ${{ env.AIHUB_ARTIFACT_NAME }}
uses: actions/[email protected]
with:
name: ${{ env.AIHUB_ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DIR }}/${{ env.AIHUB_ARTIFACT_NAME }}
- name: Creating Zip
run: zip -r ${{ env.AIHUB_ARTIFACT_NAME }}.zip ${{ env.ARTIFACT_DIR }}/${{ env.AIHUB_ARTIFACT_NAME }}/*
- name: upload artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ env.AIHUB_ARTIFACT_NAME }}.zip
asset_name: ${{ env.AIHUB_ARTIFACT_NAME }}.zip
asset_content_type: application/octet-stream