Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
asd
  • Loading branch information
stamepicmorg committed Sep 29, 2024
1 parent 1c8ce21 commit 6b434df
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 43 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and Deploy

on:
push:
branches: [ master ]
branches: [ master, develop ]
pull_request:
branches: [ master ]
branches: [ master, develop ]

defaults:
run:
Expand All @@ -13,10 +13,14 @@ defaults:
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: src

strategy:
matrix:
configuration: [Debug, Release]
# configuration: [Debug, Release]
configuration: [Debug]

steps:
- name: Checkout code
Expand All @@ -30,21 +34,36 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Patch csproj version
- name: Check current directory and files
run: |
$csproj_files = Get-ChildItem -Path '**/*.csproj'
foreach ($file in $csproj_files) {
(Get-Content $file.FullName) -replace '<Version>.*</Version>', "<Version>${{ github.run_number }}</Version>" | Set-Content $file.FullName
}
echo "Current Directory: $(pwd)"
echo "Files in current directory:"
ls -Recurse
shell: pwsh

- name: Update version
run: dotnet script UpdateVersion.csx
working-directory: src
env:
GITHUB_RUN_NUMBER: ${{ github.run_number }}

- name: Build
run: dotnet build --configuration ${{ matrix.configuration }} --verbosity minimal

- name: Publish NuGet package
if: matrix.configuration == 'Release'
run: dotnet pack --configuration Release --output ./nupkg
# - name: Publish NuGet package
# if: matrix.configuration == 'Release'
# run: dotnet pack --configuration Release --output ./nupkg

- name: Push NuGet package
# - name: Push NuGet package
# if: matrix.configuration == 'Release'
# run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

- name: Create GitHub Release
if: matrix.configuration == 'Release'
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.new_version }}
name: ${{ env.new_version }}
files: ./nupkg/*.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

25 changes: 18 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# kasthack.binding.wf

[![Nuget](https://img.shields.io/nuget/v/kasthack.binding.wf.svg)](https://www.nuget.org/packages/kasthack.binding.wf/)
[![NuGet](https://img.shields.io/nuget/dt/kasthack.binding.wf.svg)](https://www.nuget.org/packages/kasthack.binding.wf/)
[![Build status](https://img.shields.io/appveyor/ci/kasthack/kasthack-binding-wf.svg)](https://ci.appveyor.com/project/kasthack/kasthack-binding-wf)
[![license](https://img.shields.io/github/license/kasthack/kasthack.binding.wf.svg)](LICENSE)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/kasthack_binding_wf)
[![NuGet Version](https://img.shields.io/nuget/v/kasthack.binding.wf?style=flat-square&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2Fkasthack.binding.wf)](https://www.nuget.org/packages/kasthack.binding.wf/)
[![NuGet Downloads](https://img.shields.io/nuget/dt/kasthack.binding.wf?style=flat-square&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2Fkasthack.binding.wf)](https://www.nuget.org/packages/kasthack.binding.wf/)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/kasthack-labs/kasthack.binding.wf/build-and-deploy.yml?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fkasthack-labs%2Fkasthack.binding.wf%2Factions%2Fworkflows%2Fbuild-and-deploy.yml)](https://github.com/kasthack-labs/kasthack.binding.wf/actions/workflows/build-and-deploy.yml)
[![GitHub License](https://img.shields.io/github/license/kasthack-labs/kasthack.binding.wf?style=flat-square&link=LICENSE.md)](LICENSE.md)
[![GitHub repo size](https://img.shields.io/github/repo-size/kasthack-labs/kasthack.binding.wf?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fkasthack-labs%2F)](https://github.com/kasthack-labs/)
[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/kasthack-labs/kasthack.binding.wf/total?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fkasthack-labs%2Fkasthack.binding.wf%2Freleases)](https://github.com/kasthack-labs/releases)

## What
## About

Windows.Forms data binding lambda helper. Gets rid of that literal / nameof bullshit in your code.
Windows.Forms data binding lambda helper. Gets rid of that literal / nameof in your code.

## Installation

### CLI

`Install-Package kasthack.binding.wf`

### dotNet 5+

`dotnet add package kasthack.binding.wf`

### Direct in project via PackageReference

`<PackageReference Include="kasthack.binding.wf" Version="1.2.26" />`

## Usage

`control.Bind(a=>a.ControlProperty, model, a=>a.ModelProperty.ModelSubProperty)`
Expand Down
25 changes: 25 additions & 0 deletions src/UpdateVersion.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This is META-file for using ins CI.

#r "nuget: System.Xml.ReaderWriter"

using System;
using System.IO;
using System.Xml;

var versionFilePath = "src/kasthack.binding.wf.csproj";
var xmlDoc = new XmlDocument();
xmlDoc.Load(versionFilePath);

var versionNode = xmlDoc.SelectSingleNode("//Version");
var currentVersion = versionNode.InnerText;

var buildNumber = Environment.GetEnvironmentVariable("GITHUB_RUN_NUMBER");
var newVersion = $"{currentVersion.Split('.')[0]}.{currentVersion.Split('.')[1]}.{buildNumber}";

versionNode.InnerText = newVersion;
var assemblyVersionNode = xmlDoc.SelectSingleNode("//AssemblyVersion");
assemblyVersionNode.InnerText = $"{newVersion}.0";

xmlDoc.Save(versionFilePath);

Console.WriteLine($"Updated version to: {newVersion}");
4 changes: 2 additions & 2 deletions src/kasthack.binding.wf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageLicenseUrl>https://github.com/kasthack/kasthack.binding.wf/blob/master/LICENSE.md</PackageLicenseUrl>
<PackageProjectUrl>http://github.com/kasthack/kasthack.binding.wf</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.2.2</Version>
<AssemblyVersion>1.2.2.0</AssemblyVersion>
<Version>1.3.0</Version>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 6b434df

Please sign in to comment.