Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amend/workflow update #33

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Release Package

# This action will start when a correctly formatted tag is pushed (e.g. v0.1.0)

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:

- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Setup .NET 7
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x

- name: Setup .NET 8
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x

- name: Build project
run: dotnet build src\HC.PageNotFoundManager\HC.PageNotFoundManager.csproj --configuration Release /p:Version=$VERSION

- name: Pack project
run: dotnet pack --output nupkgs /p:PackageVersion=$VERSION .\src\PageNotFoundManager.sln

- name: upload nuget package
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push **\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Release Package

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
increment: patch
release_branch: main

- name: Set Version Variable
env:
TAG: ${{ steps.version.outputs.version }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Setup .NET 7
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x

- name: Setup .NET 8
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x

- name: Build project
run: dotnet build src\HC.PageNotFoundManager\HC.PageNotFoundManager.csproj --configuration Release /p:Version=$VERSION

- name: Pack project
run: dotnet pack --output nupkgs /p:PackageVersion=$VERSION .\src\PageNotFoundManager.sln
39 changes: 0 additions & 39 deletions .github/workflows/release.yml

This file was deleted.

Loading