Skip to content

Commit

Permalink
Switch to our versioning scheme and build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnavara committed Jul 27, 2024
1 parent 583ca3e commit 6c7134d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 39 deletions.
79 changes: 46 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,59 @@
name: Build
name: Build and publish

on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
branches:
- master
- dev
- preview
- v*
paths:
- "src/**"
- ".github/workflows/**"

env:
NugetApiKey: ${{secrets.NUGETAPIKEY}}
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET Core
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.201'

- name: Add .NET Workloads
run: dotnet workload install maui

dotnet-version: 8.0.x
- name: Install workloads
run: dotnet workload install -s https://api.nuget.org/v3/index.json android ios maccatalyst
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '17'
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build
run: dotnet build Build.slnf /restore -m -property:Configuration=Release -property:PublicRelease=true

- name: Publish to Nuget
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/v') }}
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ env.NugetApiKey }}
run: msbuild src/Acr.UserDialogs /p:Configuration=Release /p:PublicRelease=true /restore
- name: Pack
run: msbuild src/Acr.UserDialogs /p:Configuration=Release /p:PublicRelease=true /t:Pack
- uses: actions/upload-artifact@master
with:
name: build-artifacts
path: src/Acr.UserDialogs/bin

publish:
permissions:
packages: write
needs: build
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
include-prerelease: true
- uses: actions/download-artifact@master
with:
name: build-artifacts
path: src/Acr.UserDialogs/bin
- name: Publish
if: ${{ github.event_name == 'push' }}
env:
token: ${{ secrets.GITHUB_TOKEN }}
run: |
dotnet nuget add source https://nuget.pkg.github.com/emclient/index.json -n github
find src/Acr.UserDialogs/bin/Release -name '*.nupkg' | xargs -i dotnet nuget push {} -s github --api-key ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions src/Acr.UserDialogs/Acr.UserDialogs.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-ios;net8.0-android;net8.0-maccatalyst</TargetFrameworks>
<PackageProjectUrl>https://github.com/aritchie/userdialogs</PackageProjectUrl>
<PackageId>MailClient.Acr.UserDialogs</PackageId>
<PackageProjectUrl>https://github.com/emclient/userdialogs</PackageProjectUrl>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<Authors>Allan Ritchie</Authors>
<Authors>Allan Ritchie, eM Client</Authors>
<Description>A cross platform library that allows you to call for standard user dialogs from a shared/portable library. Supports Android, iOS, and UWP</Description>
<PackageTags>ios android xamarin xam.pcl dialogs plugin</PackageTags>
<PackageReleaseNotes>https://github.com/aritchie/userdialogs/raw/master/ChangeLog.md</PackageReleaseNotes>
<PackageIconUrl>https://github.com/aritchie/userdialogs/raw/master/icon.png</PackageIconUrl>
<PackageReleaseNotes>https://github.com/emclient/userdialogs/raw/master/ChangeLog.md</PackageReleaseNotes>
<PackageIconUrl>https://github.com/emclient/userdialogs/raw/master/icon.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);1591;1701;1591;1702;1705;VSX1000;NU1603</NoWarn>
<RepositoryUrl>https://github.com/aritchie/userdialogs</RepositoryUrl>
<RepositoryUrl>https://github.com/emclient/userdialogs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "9.0.0-alpha.{height}",
"version": "10.0.0-alpha.{height}",
"assemblyVersion": {
"precision": "revision"
},
Expand Down

0 comments on commit 6c7134d

Please sign in to comment.