Merge pull request #1 from Star-Academy/feature/authentication #3
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_Backend | |
permissions: | |
contents: write | |
packages: write | |
issues: write | |
pull-requests: write | |
deployments: write | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "6.0.x" | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build project | |
run: dotnet build --configuration Release --no-restore | |
- name: Run tests | |
run: dotnet test --no-build --verbosity normal | |
semantic-versioning: | |
runs-on: ubuntu-latest | |
needs: build # Ensure this job runs after the build job | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch the full history to calculate the next version | |
- name: Get next version | |
id: get_next_version | |
uses: thenativeweb/get-next-version@main | |
with: | |
prefix: "v" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_next_version.outputs.version }} | |
release_name: Release ${{ steps.get_next_version.outputs.version }} | |
body: | | |
content change | |
draft: false | |
prerelease: false |