Skip to content

Commit

Permalink
fix: added CI/CD for the plugin for ease of release (#10)
Browse files Browse the repository at this point in the history
* fix: added ci for biometric plugin

* fix: added cd for biometric plugin

* fix: updated ci for path issue

* fix: added the correct path for CD

* fix: added path fixes for cd

* Update main_cd.yml
  • Loading branch information
FreakyAli authored Oct 5, 2024
1 parent 506cee1 commit 6d4e359
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create a release on NuGet

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-preview[0-9]+"
jobs:
release-nuget:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: Get version information from tag
id: get_version
run: |
$version="${{github.ref_name}}".TrimStart("v")
"version-without-v=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Pack
run: dotnet pack Plugin.Maui.Biometric\Plugin.Maui.Biometric.sln -c Release -p:PackageVersion=${{ steps.get_version.outputs.version-without-v }}
- name: Push
run: dotnet nuget push Plugin.Maui.Biometric\Plugin.Maui.Biometric\bin\Release\Plugin.Maui.Biometric.${{ steps.get_version.outputs.version-without-v }}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build for CI

on:
push:
branches: [ "master" ]
paths-ignore:
- "**.md"
pull_request:
branches: [ "master" ]

jobs:
build-plugin-ci:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: dotnet build Plugin.Maui.Biometric\Plugin.Maui.Biometric.sln -c Release

0 comments on commit 6d4e359

Please sign in to comment.