Skip to content

Add Github Actions automations #4405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/auto-label.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"Infra": [".ci/**/*", ".github/**/*","build/**/*"],
"v8.0.0-alpha1": "**/*"
}
}
14 changes: 14 additions & 0 deletions .github/workflows/auto-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Label
on:
pull_request:
types: [opened, synchronize]

jobs:
auto-label:
name: Auto Label
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: banyan/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Backport
on:
pull_request:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-18.04
name: Backport
steps:
- name: Backport
uses: tibdex/backport@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
47 changes: 0 additions & 47 deletions .github/workflows/yaml-runner.yml

This file was deleted.

14 changes: 14 additions & 0 deletions build/scripts/Versioning.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ open System.Diagnostics
open System.IO
open Commandline
open Fake.Core
open Fake.Core
open Fake.IO
open Fake.IO.Globbing.Operators
open Newtonsoft.Json
Expand All @@ -25,6 +26,18 @@ module Versioning =
let jsonString = File.ReadAllText "global.json"
JsonConvert.DeserializeObject<GlobalJson>(jsonString)

let writeVersionIntoAutoLabel oldVersion newVersion =
let path = Path.Join(".github","auto-label.json")
let text = File.ReadAllText(path)
let oldV = sprintf "v%s" oldVersion
let newV = sprintf "v%s" newVersion
if not(text.Contains(oldV)) then
failwithf "auto-label.json does not contain %s" oldV

let replaced = String.replace oldV newV text
File.WriteAllText(path, replaced)


let writeVersionIntoGlobalJson version =
let globalJson = globalJson ()
let doc_current =
Expand Down Expand Up @@ -88,6 +101,7 @@ module Versioning =
if (currentVersion > newVersion) then
failwithf "Can not release %O as it's lower then current %O" newVersion.Full currentVersion.Full
writeVersionIntoGlobalJson newVersion.Full
writeVersionIntoAutoLabel (currentVersion.Full.ToString()) (newVersion.Full.ToString())
| _ -> ignore()

let ArtifactsVersion buildVersions =
Expand Down
10 changes: 8 additions & 2 deletions build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@
<Content Include="..\..\build.bat"><Link>build.bat</Link></Content>
<Content Include="..\..\appveyor.yml"><Link>appveyor.yml</Link></Content>
<Content Include="..\..\azure-pipelines.yml"><Link>azure-pipelines.yml</Link></Content>
<Content Include="..\..\.github\workflows\yaml-runner.yml">
<Link>yaml-runner.yml</Link>
<Content Include="..\..\.github\workflows\auto-label.yml">
<Link>auto-label.yml</Link>
</Content>
<Content Include="..\..\.github\workflows\backport.yml">
<Link>backport.yml</Link>
</Content>
<Content Include="..\..\.github\auto-label.json">
<Link>auto-label.json</Link>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sdk": {
"version": "3.0.100"
},
"version": "8.0.0",
"version": "8.0.0-alpha1",
"doc_current": "master",
"doc_branch": "master"
}