Skip to content

Commit 7b51bbe

Browse files
committed
chore: init EasyBuild.ShipIt configuration
1 parent 8db5354 commit 7b51bbe

17 files changed

Lines changed: 325 additions & 8 deletions

File tree

.config/dotnet-tools.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,29 @@
66
"version": "7.0.5",
77
"commands": [
88
"fantomas"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"husky": {
1213
"version": "0.8.0",
1314
"commands": [
1415
"husky"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"fsharp-analyzers": {
1820
"version": "0.36.0",
1921
"commands": [
2022
"fsharp-analyzers"
21-
]
23+
],
24+
"rollForward": false
25+
},
26+
"easybuild.shipit": {
27+
"version": "2.0.1",
28+
"commands": [
29+
"shipit"
30+
],
31+
"rollForward": false
2232
}
2333
}
24-
}
34+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# conventional-pr-title.yml
2+
name: 'Lint PR'
3+
4+
on:
5+
pull_request_target:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
# - synchronize (if you use required Actions)
11+
12+
jobs:
13+
main:
14+
name: Validate PR title
15+
runs-on: ubuntu-slim
16+
permissions:
17+
pull-requests: read
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@v6
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
workflow_run:
3+
workflows: ["build"]
4+
types:
5+
- completed
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
id-token: write
13+
14+
name: EasyBuild ShipIt
15+
16+
jobs:
17+
# Run tests and generate a Pull Request to prepare a release
18+
shipit-pr:
19+
name: ShipIt - Pull Request
20+
runs-on: ubuntu-latest
21+
# Only run if the build workflow succeeded
22+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
23+
steps:
24+
- uses: actions/checkout@v6
25+
with:
26+
# We need to fetch more than the last commit to be able to generate the changelog based on the commit history.
27+
# Adapt this value based on your needs.
28+
fetch-depth: 50
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v5
31+
with:
32+
global-json-file: global.json
33+
# Run your tests before generating the changelog to make sure everything is working fine before creating a pull request.
34+
- name: Prepare for release
35+
run: ./build.sh prepare-release
36+
- name: ShipIt (Pull Request)
37+
run: dotnet shipit --pre-release "rc"
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
release:
42+
name: Release
43+
runs-on: ubuntu-latest
44+
if: "github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_commit.message, 'chore: release ')"
45+
steps:
46+
- uses: actions/checkout@v6
47+
# Configure how you want to publish your package, e.g. using the NuGet CLI, dotnet CLI, NPM, etc.
48+
# It is recommanded to use Trusted Publishing to avoid having to manage API keys in your repository.
49+
- name: Setup .NET
50+
uses: actions/setup-dotnet@v5
51+
with:
52+
global-json-file: global.json
53+
54+
# Below is an example, for NuGet packages (to demonstrate that we are getting
55+
# the API key from the OIDC token exchange and not from a secret in the repository).
56+
- name: NuGet login (OIDC → temp API key)
57+
uses: NuGet/login@v1
58+
id: login
59+
with:
60+
# Secret is your NuGet username, e.g. andrewlock
61+
# This is actually a public information, so we can using a secret is probably overkill
62+
user: ${{ secrets.NUGET_USER }}
63+
64+
- name: Build, and Release
65+
run: |
66+
./build.sh github-release
67+
env:
68+
FABLE_NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.markdownlint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
},
55
"MD013": false,
66
"MD024": false,
7+
"MD033": false,
78
"MD038": false,
89
"MD050": false
910
}

src/Fable.AST/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
---
2+
last_commit_released: 64c4dfdc595ed6720fcd053bee1f2d2930e4ead1
3+
---
4+
15
# Changelog
26

37
All notable changes to this project will be documented in this file.
48

59
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
610
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
711

12+
## 5.0.0-rc.5 - 2026-04-08
13+
14+
<strong><small>[View changes on Github](https://github.com/fable-compiler/Fable/compare/8db5354262492b0ca0c5d49da239cfbcf0dcfc45..64c4dfdc595ed6720fcd053bee1f2d2930e4ead1)</small></strong>
15+
816
## Unreleased
917

1018
## 5.0.0-rc.4 - 2026-04-07
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
module Build.AutomatedRelease
2+
3+
open System
4+
open System.IO
5+
open Build.Workspace
6+
open SimpleExec
7+
open BlackFox.CommandLine
8+
open EasyBuild.Tools.Git
9+
open Build.FableLibrary
10+
open EasyBuild.Tools.DotNet
11+
open EasyBuild.Tools.Changelog
12+
open EasyBuild.Tools.PackageJson
13+
open EasyBuild.Tools.Npm
14+
15+
let private createGithubRelease (version: LastVersionFinder.Version) =
16+
17+
let struct (lastestTag, _) =
18+
Command.ReadAsync("git", "describe --abbrev=0 --tags")
19+
|> Async.AwaitTask
20+
|> Async.RunSynchronously
21+
22+
let versionText = version.Version.ToString()
23+
24+
// Only create a Github release if the tag doesn't exist
25+
// It can happens that we trigger a release where Fable.Cli
26+
// is already up to date.
27+
if lastestTag.Trim() <> versionText then
28+
Command.Run(
29+
"gh",
30+
CmdLine.empty
31+
|> CmdLine.appendRaw "release"
32+
|> CmdLine.appendRaw "create"
33+
|> CmdLine.appendRaw versionText
34+
|> CmdLine.appendPrefix "--title" versionText
35+
|> CmdLine.appendPrefix "--notes" version.Body
36+
|> CmdLine.appendIf version.Version.IsPrerelease "--prerelease"
37+
|> CmdLine.toString
38+
)
39+
40+
let private createReleaseCommitAndPush (version: LastVersionFinder.Version) =
41+
let versionText = version.Version.ToString()
42+
43+
Git.addAll ()
44+
Git.commit ($"Release %s{versionText}")
45+
Git.push ()
46+
47+
let handle (args: string list) =
48+
let struct (currentBranch, _) =
49+
Command.ReadAsync("git", "rev-parse --abbrev-ref HEAD")
50+
|> Async.AwaitTask
51+
|> Async.RunSynchronously
52+
53+
if currentBranch.Trim() <> "main" then
54+
failwith "You must be on the main branch to release"
55+
56+
// let prepareOnly = args |> List.contains "--prepare-only"
57+
58+
59+
// Build all the fable-libraries
60+
// Force rebuld of fable-libraries to make sure they are generated with the latest
61+
// version of the compiler
62+
BuildFableLibraryBeam().Run(true)
63+
BuildFableLibraryDart().Run(true)
64+
BuildFableLibraryJavaScript().Run(true)
65+
BuildFableLibraryPython().Run(true)
66+
BuildFableLibraryRust().Run(true)
67+
BuildFableLibraryTypeScript().Run(true)
68+
69+
// Handle the NPM packages
70+
71+
// We also want to update the original package.json if needed
72+
// This is to keep the versions consistent across the project
73+
PackageJson.replaceVersion (PackageJson.fableLibraryTs, Changelog.fableLibraryTs |> Changelog.findLastVersion)
74+
75+
// publishNpm ProjectDir.fable_metadata
76+
77+
// // Update embedded version (both compiler and libraries)
78+
// let compilerVersion =
79+
// Path.Combine(ProjectDir.fableCli, "CHANGELOG.md")
80+
// |> FileInfo
81+
// |> Changelog.findLastVersion
82+
83+
// updateLibraryVersionInFableTransforms
84+
// compilerVersion
85+
// {|
86+
// JavaScript = PackageJson.tempFableLibraryJs |> PackageJson.getVersion
87+
// TypeScript = PackageJson.tempFableLibraryTs |> PackageJson.getVersion
88+
// |}
89+
90+
// publishNuget ProjectDir.fableAst false
91+
// publishNuget ProjectDir.fableCore false
92+
// publishNuget ProjectDir.fableCompiler true
93+
// publishNuget ProjectDir.fableCli false
94+
// publishNuget ProjectDir.fablePublishUtils false
95+
96+
// // Release fable-compiler-js and fable-standalone after Fable.Cli
97+
// // otherwise the reported version for Fable will be wrong
98+
99+
// // Trigger fable-compiler-js target to make sure everything is ready for publish
100+
// // Note: fable-standalone is built as part of fable-compiler-js
101+
// // so no need to build it separately
102+
// // Note 2: We already built fable-library, it will be skipped thanks to incremental build
103+
// CompilerJs.handle []
104+
105+
// publishNpm ProjectDir.fable_standalone
106+
// publishNpm ProjectDir.fable_compiler_js

src/Fable.Build/Fable.Build.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<Compile Include="FcsRepo.fs" />
4040
<Compile Include="Publish.fs" />
4141
<Compile Include="GithubRelease.fs" />
42+
<Compile Include="AutomatedRelease.fs" />
4243
<Compile Include="Package.fs" />
4344
<Compile Include="Main.fs" />
4445
</ItemGroup>

src/Fable.Build/GithubRelease.fs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Build.GithubRelease
22

3+
open System
34
open System.IO
45
open Build.Workspace
56
open SimpleExec
@@ -47,8 +48,12 @@ let handle (args: string list) =
4748
if currentBranch.Trim() <> "main" then
4849
failwith "You must be on the main branch to release"
4950

50-
// Check if the user is authenticated
51-
Command.Run("gh", "auth status")
51+
// Skip interactive auth check in CI environments (GH_TOKEN will be used)
52+
let isCI = Environment.GetEnvironmentVariable("CI") |> Option.ofObj |> Option.isSome
53+
54+
if not isCI then
55+
// Check if the user is authenticated locally
56+
Command.Run("gh", "auth status")
5257

5358
let skipPublish = args |> List.contains "--skip-publish"
5459

src/Fable.Cli/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
---
2+
last_commit_released: 64c4dfdc595ed6720fcd053bee1f2d2930e4ead1
3+
updaters:
4+
- regex:
5+
file: ./../Fable.Transforms/Global/Compiler.fs
6+
pattern: (?<=let VERSION = ").*(?=")
7+
---
8+
19
# Changelog
210

311
All notable changes to this project will be documented in this file.
412

513
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
614
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
715

8-
## Unreleased
16+
## 5.0.0-rc.8 - 2026-04-08
17+
18+
<strong><small>[View changes on Github](https://github.com/fable-compiler/Fable/compare/8db5354262492b0ca0c5d49da239cfbcf0dcfc45..64c4dfdc595ed6720fcd053bee1f2d2930e4ead1)</small></strong>
919

1020
## 5.0.0-rc.7 - 2026-04-07
1121

src/Fable.Compiler/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
1+
---
2+
last_commit_released: 64c4dfdc595ed6720fcd053bee1f2d2930e4ead1
3+
include:
4+
- ../fable-library-beam/
5+
- ../fable-library-dart/
6+
- ../fable-library-php/
7+
- ../fable-library-php/
8+
- ../fable-library-py/
9+
- ../fable-library-rust/
10+
- ../fable-library-ts/
11+
- ../Fable.Compiler/
12+
- ../Fable.Transforms/
13+
- ../Fable.AST/
14+
- ../../lib/
15+
---
16+
117
# Changelog
218

319
All notable changes to this project will be documented in this file.
420

521
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
622
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
723

24+
## 5.0.0-rc.14 - 2026-04-08
25+
26+
<strong><small>[View changes on Github](https://github.com/fable-compiler/Fable/compare/8db5354262492b0ca0c5d49da239cfbcf0dcfc45..64c4dfdc595ed6720fcd053bee1f2d2930e4ead1)</small></strong>
27+
828
## Unreleased
929

1030
## 5.0.0-rc.13 - 2026-04-07

0 commit comments

Comments
 (0)