Skip to content

Commit

Permalink
housekeeping: Update release scripts to use environments (#2988)
Browse files Browse the repository at this point in the history
* housekeeping: Update release scripts to use environments

* Add release
  • Loading branch information
glennawatson authored Oct 31, 2021
1 parent a8398a3 commit adae89f
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 60 deletions.
4 changes: 0 additions & 4 deletions .github/release-drafter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:

- name: Restore/Build the sample
run: msbuild IntegrationTests.All.sln /t:restore,build /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=Release
working-directory: integrationtests
working-directory: integrationtests
56 changes: 1 addition & 55 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]

env:
Expand Down Expand Up @@ -122,57 +121,4 @@ jobs:
uses: actions/upload-artifact@master
with:
name: nuget
path: '**/*.nupkg'

release:
runs-on: ubuntu-latest
needs: build
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download NuGet Packages
uses: actions/download-artifact@v2
with:
name: nuget

- name: Save SignClient Configuration
run: 'echo "$SIGN_CLIENT_CONFIG" > SignPackages.json'
shell: bash
env:
SIGN_CLIENT_CONFIG: ${{secrets.SIGN_CLIENT_CONFIG}}

- name: Sign NuGet Packages
uses: glennawatson/signclient@v1
with:
input-files: '**/*.nupkg'
sign-client-secret: ${{ secrets.SIGN_CLIENT_SECRET }}
sign-client-user: ${{ secrets.SIGN_CLIENT_USER_ID }}
project-name: reactiveui
description: reactiveui
config-file: SignPackages.json

- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ needs.build.outputs.nbgv }}
release_name: ${{ needs.build.outputs.nbgv }}
body: |
${{ steps.changelog.outputs.commitLog }}
- name: NuGet Push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg
path: '**/*.nupkg'
122 changes: 122 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Build and Release

on:
push:
branches: [ main ]

env:
configuration: Release
productNamespacePrefix: "ReactiveUI"

jobs:
release:
runs-on: windows-2022
environment:
name: release
steps:
- name: Update VS2022 preview
shell: bash
run: |
dotnet tool update -g dotnet-vs
vs modify preview +mobile +desktop +uwp +web
echo "##vso[task.prependpath]$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin"
- name: Install Windows SDK 10.0.16299
shell: pwsh
run: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/p/?linkid=864422 -OutFile winsdk.exe
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "winsdk.exe"
$startInfo.Arguments = "/norestart /quiet"
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start()
$process.WaitForExit()
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 3.1.x

- name: Install .NET 5
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 5.0.x

- name: Install .NET 6
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 6.0.x
include-prerelease: true

- name: Install DotNet workloads
shell: bash
run: |
dotnet workload install android
dotnet workload install ios
dotnet workload install tvos
dotnet workload install macos
dotnet workload install maui
dotnet tool install -g Redth.Net.Maui.Check
maui-check --non-interactive --fix
- name: Add MSBuild to PATH
uses: glennawatson/setup-msbuild@v1.0.3
with:
prerelease: true

- name: NBGV
id: nbgv
uses: dotnet/nbgv@master
with:
setAllVars: true

- name: NuGet Restore
run: dotnet restore
working-directory: src

- name: Build
run: msbuild /t:build,pack /nowarn:MSB4011 /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }}
working-directory: src

- name: Save SignClient Configuration
run: 'echo "$SIGN_CLIENT_CONFIG" > SignPackages.json'
shell: bash
env:
SIGN_CLIENT_CONFIG: ${{secrets.SIGN_CLIENT_CONFIG}}

- name: Sign NuGet Packages
uses: glennawatson/signclient@v1
with:
input-files: '**/*.nupkg'
sign-client-secret: ${{ secrets.SIGN_CLIENT_SECRET }}
sign-client-user: ${{ secrets.SIGN_CLIENT_USER_ID }}
project-name: reactiveui
description: reactiveui
config-file: SignPackages.json

- name: Changelog
uses: glennawatson/ChangeLog@v1
id: changelog

- name: Create Release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
body: |
${{ steps.changelog.outputs.commitLog }}
- name: NuGet Push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName=".NET Framework 4.7.2")]
namespace ReactiveUI.Blend
{
public class FollowObservableStateBehavior : Microsoft.Xaml.Behaviors.Behavior<System.Windows.FrameworkElement>
{
public static readonly System.Windows.DependencyProperty StateObservableProperty;
public static readonly System.Windows.DependencyProperty TargetObjectProperty;
public FollowObservableStateBehavior() { }
public bool AutoResubscribeOnError { get; set; }
public System.IObservable<string> StateObservable { get; set; }
public System.Windows.FrameworkElement TargetObject { get; set; }
protected override void OnDetaching() { }
protected static void OnStateObservableChanged(System.Windows.DependencyObject? sender, System.Windows.DependencyPropertyChangedEventArgs e) { }
}
public class ObservableTrigger : Microsoft.Xaml.Behaviors.TriggerBase<System.Windows.FrameworkElement>
{
public static readonly System.Windows.DependencyProperty ObservableProperty;
public ObservableTrigger() { }
public bool AutoResubscribeOnError { get; set; }
public System.IObservable<object> Observable { get; set; }
protected static void OnObservableChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName="")]
[assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")]
namespace ReactiveUI.Winforms
{
public class ActivationForViewFetcher : ReactiveUI.IActivationForViewFetcher, Splat.IEnableLogger
{
public ActivationForViewFetcher() { }
public System.IObservable<bool> GetActivationForView(ReactiveUI.IActivatableView view) { }
public int GetAffinityForView(System.Type view) { }
}
public class ContentControlBindingHook : ReactiveUI.IPropertyBindingHook
{
public ContentControlBindingHook() { }
public bool ExecuteHook(object? source, object target, System.Func<ReactiveUI.IObservedChange<, >[]> getCurrentViewModelProperties, System.Func<ReactiveUI.IObservedChange<, >[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction) { }
}
public class CreatesWinformsCommandBinding : ReactiveUI.ICreatesCommandBinding
{
public CreatesWinformsCommandBinding() { }
public System.IDisposable? BindCommandToObject(System.Windows.Input.ICommand? command, object? target, System.IObservable<object?> commandParameter) { }
public System.IDisposable? BindCommandToObject<TEventArgs>(System.Windows.Input.ICommand? command, object? target, System.IObservable<object?> commandParameter, string eventName) { }
public int GetAffinityForObject(System.Type type, bool hasEventTarget) { }
}
public class PanelSetMethodBindingConverter : ReactiveUI.ISetMethodBindingConverter, Splat.IEnableLogger
{
public PanelSetMethodBindingConverter() { }
public int GetAffinityForObjects(System.Type? fromType, System.Type? toType) { }
public object PerformSet(object? toTarget, object? newValue, object?[]? arguments) { }
}
public class PlatformOperations : ReactiveUI.IPlatformOperations
{
public PlatformOperations() { }
public string? GetOrientation() { }
}
public class ReactiveUserControl<TViewModel> : System.Windows.Forms.UserControl, ReactiveUI.IActivatableView, ReactiveUI.IViewFor, ReactiveUI.IViewFor<TViewModel>
where TViewModel : class
{
public ReactiveUserControl() { }
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.Description("The ViewModel.")]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public TViewModel ViewModel { get; set; }
protected override void Dispose(bool disposing) { }
}
public class Registrations
{
public Registrations() { }
public void Register(System.Action<System.Func<object>, System.Type> registerFunction) { }
}
[System.ComponentModel.DefaultProperty("ViewModel")]
public class RoutedControlHost : System.Windows.Forms.UserControl, ReactiveUI.IReactiveObject, Splat.IEnableLogger, System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.INotifyPropertyChanging
{
public RoutedControlHost() { }
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.Description("The default control when no viewmodel is specified")]
public System.Windows.Forms.Control? DefaultContent { get; set; }
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.Description("The router.")]
public ReactiveUI.RoutingState? Router { get; set; }
[System.ComponentModel.Browsable(false)]
public System.IObservable<string>? ViewContractObservable { get; set; }
[System.ComponentModel.Browsable(false)]
public ReactiveUI.IViewLocator? ViewLocator { get; set; }
public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged;
public event System.ComponentModel.PropertyChangingEventHandler? PropertyChanging;
protected override void Dispose(bool disposing) { }
}
public class TableContentSetMethodBindingConverter : ReactiveUI.ISetMethodBindingConverter, Splat.IEnableLogger
{
public TableContentSetMethodBindingConverter() { }
public int GetAffinityForObjects(System.Type? fromType, System.Type? toType) { }
public object PerformSet(object? toTarget, object? newValue, object?[]? arguments) { }
}
[System.ComponentModel.DefaultProperty("ViewModel")]
public class ViewModelControlHost : System.Windows.Forms.UserControl, ReactiveUI.IActivatableView, ReactiveUI.IReactiveObject, ReactiveUI.IViewFor, Splat.IEnableLogger, System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.INotifyPropertyChanging
{
public ViewModelControlHost() { }
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.DefaultValue(true)]
[System.ComponentModel.Description("Cache Views")]
public bool CacheViews { get; set; }
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.Description("The Current View")]
public object? Content { get; set; }
public System.Windows.Forms.Control? CurrentView { get; }
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.Description("The default control when no viewmodel is specified")]
public System.Windows.Forms.Control? DefaultContent { get; set; }
[System.ComponentModel.Browsable(false)]
public System.IObservable<string>? ViewContractObservable { get; set; }
[System.ComponentModel.Browsable(false)]
public ReactiveUI.IViewLocator? ViewLocator { get; set; }
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Category("ReactiveUI")]
[System.ComponentModel.Description("The viewmodel to host.")]
public object? ViewModel { get; set; }
public static bool DefaultCacheViewsEnabled { get; set; }
public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged;
public event System.ComponentModel.PropertyChangingEventHandler? PropertyChanging;
protected override void Dispose(bool disposing) { }
}
public class WinformsCreatesObservableForProperty : ReactiveUI.ICreatesObservableForProperty, Splat.IEnableLogger
{
public WinformsCreatesObservableForProperty() { }
public int GetAffinityForObject(System.Type type, string propertyName, bool beforeChanged = false) { }
public System.IObservable<ReactiveUI.IObservedChange<object, object?>> GetNotificationForProperty(object sender, System.Linq.Expressions.Expression expression, string propertyName, bool beforeChanged = false, bool suppressWarnings = false) { }
}
}
namespace System.Reactive.Concurrency
{
public class ControlScheduler : System.Reactive.Concurrency.LocalScheduler, System.Reactive.Concurrency.ISchedulerPeriodic { }
}
namespace System.Reactive.Linq
{
public static class ControlObservable { }
}

0 comments on commit adae89f

Please sign in to comment.