Skip to content

1.2.0 (#28)

1.2.0 (#28) #14

name: GithubActionsRelease
############################################################################################################
# All of thes jobs runs commands only on a tag push in the Material-Blazor\Material.Blazor repository
# The publishing actions in forked repositories were handled by the WIP workflow
# An 'ExitWorkflow' action is sorely needed
############################################################################################################
# NUGET_API_KEY is valid through 9/11/2021
############################################################################################################
on:
push:
tags:
- '*' # Push events to matching *, i.e. 1.0, 20.15.10
env:
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
outputCSFB: ${{github.workspace}}\siteCSFB
projectCSFB: 'HttpSecurity.AspNet/HttpSecurity.AspNet.csproj'
jobs:
############################################################################################################
# These jobs are used to gate actions. By creating these jobs we don't need to proliferate the repo checks
############################################################################################################
is-on-fork:
name: Running on a fork?
runs-on: ubuntu-latest
if: github.repository != 'Material-Blazor/HttpSecurity.AspNet'
steps:
- name: Nothing to see here
run: echo ""
is-on-material-blazor:
name: Running on Material-Blazor/HttpSecurity.AspNet?
runs-on: ubuntu-latest
if: github.repository == 'Material-Blazor/HttpSecurity.AspNet'
steps:
- name: Nothing to see here
run: echo ""
############################################################################################################
# Build package and deploy
############################################################################################################
build-and-deploy-package:
name: Build nuget package & deploy to nuget
needs: [is-on-material-blazor]
runs-on: windows-latest
steps:
- name: Get the version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Checkout repository under $GITHUB_WORKSPACE so the job can access it 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Build HttpSecurity.AspNet 🔧
run: dotnet build ${{env.projectCSFB}} --configuration ${{env.buildConfiguration}} -p:Version=${{env.version}}
- name: Generate the NuGet package 🔧
run: dotnet pack ${{env.projectCSFB}} --no-build --configuration ${{env.buildConfiguration}} --output ${{env.outputCSFB}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:Version=${{env.version}}
- name: Display HttpSecurity.AspNet package output Ꙫ
run: dir ${{env.outputCSFB}}
- name: Upload Package 🚀
run: dotnet nuget push ${{env.outputCSFB}}\*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
############################################################################################################
# Create release
############################################################################################################
create-release:
name: Create release
needs: [build-and-deploy-package, is-on-material-blazor]
runs-on: ubuntu-latest
steps:
- name: Get the version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: Release ${{env.version}}
tag: ${{env.version}}