@@ -61,38 +61,46 @@ outputs:
61
61
* `no-update`: No update was available.
62
62
* `update-success`: An update was available and lean-action step was successful.
63
63
* `update-fail`: An update was available but the lean-action step failed.
64
- value : ${{ steps.record-outcome.outputs.outcome }}
64
+ value : ${{ steps.record-result.outputs.outcome }}
65
+ latest_lean :
66
+ description : | # markdown
67
+ The latest Lean release version, including both stable and pre-release versions.
68
+ value : ${{ steps.record-latest-lean.outputs.latest_lean }}
65
69
runs :
66
70
using : " composite"
67
71
steps :
68
72
- name : Update lean-toolchain
69
73
run : |
70
- cd ${{ inputs.lake_package_directory }}
74
+ : Update lean-toolchain
71
75
node ${{ github.action_path }}/scripts/getLatest.js
72
76
env :
73
77
GH_TOKEN : ${{ github.token }}
74
78
shell : bash
79
+ working-directory : ${{ inputs.lake_package_directory }}
75
80
76
81
- name : Install elan
77
82
run : |
83
+ : Install elan
78
84
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y
79
85
echo "$HOME/.elan/bin" >> $GITHUB_PATH
80
86
shell : bash
81
87
82
88
- name : Update dependencies of ${{ github.repository }}
83
89
run : |
84
- cd ${{ inputs.lake_package_directory }}
90
+ : Update dependencies
85
91
lake update
86
92
shell : bash
93
+ working-directory : ${{ inputs.lake_package_directory }}
87
94
88
95
- name : Check if lean-toolchain or lake-manifest.json were updated
89
96
id : check-update
90
97
run : |
91
- cd ${{ inputs.lake_package_directory }}
98
+ : Check if lean-toolchain or lake-manifest.json were updated
92
99
node ${{ github.action_path }}/scripts/checkChanges.js
93
100
env :
94
101
UPDATE_IF_MODIFIED : ${{ inputs.update_if_modified }}
95
102
shell : bash
103
+ working-directory : ${{ inputs.lake_package_directory }}
96
104
97
105
- name : Try to build lean if something was updated
98
106
if : steps.check-update.outputs.files_changed == 'true'
@@ -103,9 +111,13 @@ runs:
103
111
build-args : ${{ inputs.build_args }}
104
112
lake-package-directory : ${{ inputs.lake_package_directory }}
105
113
106
- - name : Record outcome
107
- id : record-outcome
114
+ # -------------------------------- #
115
+ # record the output of this action #
116
+ # -------------------------------- #
117
+ - name : Record the outcome
118
+ id : record-result
108
119
run : | # bat
120
+ : Record the outcome
109
121
if [ "${{ steps.check-update.outputs.files_changed }}" == "false" ]; then
110
122
echo "No update available"
111
123
echo "outcome=no-update" >> $GITHUB_OUTPUT
@@ -118,6 +130,16 @@ runs:
118
130
fi
119
131
shell : bash
120
132
133
+ - name : Record the latest Lean version
134
+ id : record-latest-lean
135
+ run : |
136
+ : Record the latest Lean version
137
+ LEAN_VERSION=$(cat lean-toolchain | sed 's/leanprover\/lean4://')
138
+ echo "Latest Lean release is: $LEAN_VERSION"
139
+ echo "latest_lean=$LEAN_VERSION" >> $GITHUB_OUTPUT
140
+ shell : bash
141
+ working-directory : ${{ inputs.lake_package_directory }}
142
+
121
143
# ------------------------- #
122
144
# when update is successful #
123
145
# ------------------------- #
@@ -135,6 +157,7 @@ runs:
135
157
- name : Open issue if the updated lean build was successful
136
158
if : steps.build-lean.outcome == 'success' && inputs.on_update_succeeds == 'issue' && steps.check-update.outputs.do_update == 'true'
137
159
run : | # bat
160
+ : Open issue if the updated lean build was successful
138
161
CHANGED_FILES="${{ steps.check-update.outputs.changed_files }}"
139
162
BULLET_LIST=""
140
163
for file in $CHANGED_FILES; do
@@ -164,6 +187,7 @@ runs:
164
187
- name : Open issue if the updated lean build fails
165
188
if : steps.build-lean.outcome == 'failure' && inputs.on_update_fails == 'issue'
166
189
run : | # bat
190
+ : Open issue if the updated lean build fails
167
191
CHANGED_FILES="${{ steps.check-update.outputs.changed_files }}"
168
192
BULLET_LIST=""
169
193
for file in $CHANGED_FILES; do
@@ -182,7 +206,9 @@ runs:
182
206
183
207
- name : Action fails if the updated lean build fails
184
208
if : steps.build-lean.outcome == 'failure' && inputs.on_update_fails == 'fail'
185
- run : exit 1
209
+ run : |
210
+ : Action fails if the updated lean build fails
211
+ exit 1
186
212
shell : bash
187
213
188
214
branding :
0 commit comments