Merge pull request #6 from arabcoders/dev #4
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: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: "Log level" | |
required: true | |
default: "warning" | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
push: | |
tags: | |
- "*" | |
env: | |
DOTNET_VERSION: "6.0.x" | |
jobs: | |
Tests: | |
uses: ./.github/workflows/tests.yml | |
publish: | |
needs: Tests | |
name: build_package | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: restore cached dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: ${{ runner.os }}-nuget | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build CustomMetadataDB --configuration Release --no-restore | |
- name: Publish | |
run: dotnet publish CustomMetadataDB --configuration Release --no-restore --output bin | |
- name: Package | |
id: create_package | |
shell: bash | |
run: | | |
tag=$(git describe --tags --always) | |
release_name="CustomMetadataDB-${tag}" | |
# Pack files. | |
7z a -tzip "${release_name}.zip" "./bin/CustomMetadataDB.dll" | |
# Create tags. | |
echo "release_name=${release_name}" >> "$GITHUB_OUTPUT" | |
echo "release_tag=${tag}" >> "$GITHUB_OUTPUT" | |
echo "filename=${release_name}.zip" >> "$GITHUB_OUTPUT" | |
- name: Release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GH_TOKEN }}" | |
title: "${{ steps.create_package.outputs.release_tag }}" | |
automatic_release_tag: "${{ steps.create_package.outputs.release_tag }}" | |
prerelease: true | |
files: | | |
*.zip |