Create release. #11
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 Release | |
on: | |
#create: | |
# branches: # Not filter wiht branches name of chreate. | |
# - 'release/**' | |
push: | |
branches: | |
- 'release/**' | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.sln' | |
#pull_request: | |
# types: [opened, synchronize, reopened] | |
# branches: [ master ] | |
# paths-ignore: | |
# - '**/*.md' | |
jobs: | |
build_release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Get Version | |
uses: nivaes/version-run-number@develop | |
id: version_run_number | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: | | |
3.1.x | |
5.0.x | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build | |
run: dotnet build --configuration Release -p:Version=${{ steps.version_run_number.outputs.version }} | |
- name: Test | |
run: dotnet test --configuration Release --no-build --verbosity normal | |
- name: Pack | |
if: github.event_name == 'push' || (github.event_name != 'pull_request') | |
run: dotnet pack --configuration Release --no-build --verbosity normal --output ./Artifacts/ -p:Version=${{ steps.version_run_number.outputs.version }} | |
- name: Create Release | |
if: github.event_name == 'push' || (github.event_name != 'pull_request') | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: release/v${{ steps.version_run_number.outputs.version }} | |
release_name: Release Version ${{ steps.version_run_number.outputs.version }} | |
body: | | |
Automatic Release ${{ steps.version_run_number.outputs.version }} | |
- Release automatically generated. | |
draft: true | |
prerelease: false | |
- name: Upload Release Asset | |
uses: nivaes/upload-release-assets@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
targets: ./Artifacts/*.nupkg |