This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
forked from koenvzeijl/AspNetCore.SassCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: deploy-nuget | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Tag to publish v[0-9]+.[0-9]+.[0-9]+*' | ||
required: true | ||
default: '' | ||
type: string | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
jobs: | ||
get-version: | ||
name: Get version to deploy | ||
runs-on: ubuntu-latest | ||
env: | ||
VERSION: 1.0.0 | ||
outputs: | ||
VERSION: ${{ steps.output-version.outputs.VERSION }} | ||
steps: | ||
- name: Set tag from input | ||
if: ${{ github.event.inputs.version != '' }} | ||
env: | ||
TAG: ${{ github.event.inputs.version }} | ||
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
|
||
- name: Set version variable from tag | ||
if: ${{ github.ref_type == 'tag' }} | ||
env: | ||
TAG: ${{ github.ref_name }} | ||
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
|
||
- name: VERSION to job output | ||
id: output-version | ||
run: | | ||
echo "VERSION=${{ env.VERSION }}" >> $GITHUB_OUTPUT | ||
deploy-nuget: | ||
name: Deploy mudblazor sasscompiler nuget to nuget.org | ||
needs: get-version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: 'refs/tags/v${{ needs.get-version.outputs.VERSION }}' | ||
- name: Setup dotnet version | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
7.0.x | ||
- name: Pack nuget package | ||
run: dotnet pack -c Release --output nupkgs /p:PackageVersion=${{ needs.get-version.outputs.VERSION }} /p:AssemblyVersion=${{ needs.get-version.outputs.VERSION }} /p:Version=${{ needs.get-version.outputs.VERSION }} | ||
working-directory: ./AspNetCore.SassCompiler | ||
- name: Publish nuget package | ||
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
working-directory: ./AspNetCore.SassCompiler | ||
- name: Push nuget generated package symbols | ||
run: dotnet nuget push nupkgs/*.snupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
working-directory: ./AspNetCore.SassCompiler |