Skip to content

Update main.yml

Update main.yml #2

Workflow file for this run

name: Build and Release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0'
- name: Restore dependencies
run: dotnet restore
- name: Build the project
run: dotnet build --configuration Release
- name: Run tests
run: dotnet test
release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create a Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: SyatiModuleBuildTool.zip
asset_name: SyatiModuleBuildTool.zip
asset_content_type: application/zip