Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Replace build.yml with main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
milandjurdjevic committed May 3, 2024
1 parent 833c82f commit 0cb8455
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 25 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/build.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: main

on:
push:
branches:
- 'main'
tags:
- '*.*.*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore src
- name: Build
run: dotnet build src --no-restore
- name: Test
run: dotnet test src --no-build --verbosity normal
publish:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Pack
run: dotnet pack src/Strinum --configuration Release --output ${{ github.workspace }}/.nuget
- name: Push
run: dotnet nuget push ${{ github.workspace }}/.nuget/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Strinum ${{ github.ref }}
draft: false
prerelease: false

0 comments on commit 0cb8455

Please sign in to comment.