Skip to content

Commit a0d6ac6

Browse files
authored
Merge pull request #8 from kencyke/7-release-action
Release action
2 parents 04464fd + 2ae36da commit a0d6ac6

File tree

4 files changed

+81
-12
lines changed

4 files changed

+81
-12
lines changed

.github/workflows/release-lean.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release Lean
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
paths:
9+
- lean-toolchain
10+
11+
jobs:
12+
release:
13+
if: github.event.pull_request.merged == true
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Determine current Lean tag from lean-toolchain
24+
id: current
25+
shell: bash
26+
run: |
27+
set -euo pipefail
28+
toolchain="$(cat lean-toolchain)"
29+
tag="${toolchain##*:}"
30+
if [[ -z "$tag" ]]; then
31+
echo "Failed to parse lean-toolchain: $toolchain" >&2
32+
exit 1
33+
fi
34+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
35+
36+
- name: Check if tag already exists
37+
id: tag_exists
38+
shell: bash
39+
run: |
40+
if git tag -l "${{ steps.current.outputs.tag }}" | grep -q .; then
41+
echo "exists=true" >> "$GITHUB_OUTPUT"
42+
echo "Tag '${{ steps.current.outputs.tag }}' already exists; skipping release."
43+
else
44+
echo "exists=false" >> "$GITHUB_OUTPUT"
45+
fi
46+
47+
- name: Create GitHub Release
48+
if: steps.tag_exists.outputs.exists != 'true'
49+
uses: softprops/action-gh-release@v2
50+
with:
51+
tag_name: ${{ steps.current.outputs.tag }}
52+
target_commitish: ${{ github.sha }}
53+
prerelease: ${{ contains(steps.current.outputs.tag, '-') }}
54+
generate_release_notes: true

.vscode/mcp.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"inputs": [],
3+
"servers": {
4+
"lean-lsp": {
5+
"type": "stdio",
6+
"command": "uvx",
7+
"args": [
8+
"lean-lsp-mcp"
9+
]
10+
}
11+
}
12+
}

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ Build completed successfully (498 jobs).
1414
## How to use
1515

1616
1. Create a repository from this template.
17-
2. Confirm lint settings in `package.json`, `.lefthook/`, and `lefthook.yml`.
18-
3. Remove `Project.lean` and `Project/`.
19-
4. Make your project files, then update `lakefile.toml`.
20-
5. Bump lean version in `.devcontainer/Dockerfile`, `lakefile.toml`, and `lean-toolchain`.
21-
6. Reomve `lake-manifest.json` and `.lake/`.
22-
7. Execute `lake exe cache get`.
17+
2. Confirm github workflows in `.github/workflows/`.
18+
3. Confirm lint settings in `package.json`, `.lefthook/`, and `lefthook.yml`.
19+
4. Remove `Project.lean` and `Project/`.
20+
5. Make your project files, then update `lakefile.toml`.
21+
6. Bump lean version in `.devcontainer/Dockerfile`, `lakefile.toml`, and `lean-toolchain`.
22+
7. Reomve `lake-manifest.json` and `.lake/`.
23+
8. Execute `lake exe cache get`.
2324

2425
## Recommend to use
2526

lakefile.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ name = "Project"
22
version = "0.1.0"
33
defaultTargets = ["Project"]
44

5+
[leanOptions]
6+
warningAsError = true
7+
pp.unicode.fun = true
8+
autoImplicit = false
9+
relaxedAutoImplicit = false
10+
linter.mathlibStandardSet = true
11+
linter.style.longLine = false
12+
513
[[lean_lib]]
614
name = "Project"
7-
leanOptions.warningAsError = true
8-
leanOptions.pp.unicode.fun = true
9-
leanOptions.autoImplicit = false
10-
leanOptions.relaxedAutoImplicit = false
11-
leanOptions.linter.mathlibStandardSet = true
12-
leanOptions.linter.style.longLine = false
1315

1416
[[require]]
1517
name = "mathlib"

0 commit comments

Comments
 (0)