Skip to content

Commit 588356a

Browse files
mhuisiclaude
andauthored
chore: consolidate workflows (#731)
OIDC via npm does not like multiple workflow files. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7339887 commit 588356a

File tree

8 files changed

+129
-127
lines changed

8 files changed

+129
-127
lines changed

.github/workflows/on-push.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: vscode-lean4 build
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
action:
7+
description: 'Action to perform'
8+
required: true
9+
type: choice
10+
options:
11+
- publish-packages
12+
- release
13+
- pre-release
414
pull_request:
515
branches:
616
- '*'
@@ -16,6 +26,7 @@ permissions:
1626

1727
jobs:
1828
build-and-test:
29+
if: github.event_name != 'workflow_dispatch'
1930
strategy:
2031
fail-fast: false
2132
matrix:
@@ -189,3 +200,105 @@ jobs:
189200
uses: GabrielBB/xvfb-action@v1.0
190201
with:
191202
run: npm run test
203+
204+
publish-packages:
205+
if: github.event_name == 'workflow_dispatch' && inputs.action == 'publish-packages'
206+
runs-on: ubuntu-latest
207+
steps:
208+
- name: Checkout
209+
uses: actions/checkout@v2
210+
211+
- name: Setup Node.js
212+
uses: actions/setup-node@v4
213+
with:
214+
node-version: '24'
215+
registry-url: 'https://registry.npmjs.org'
216+
217+
- name: Build
218+
run: |
219+
npm ci
220+
npm run build
221+
222+
- name: Try publishing infoview-api
223+
continue-on-error: true
224+
run: npm publish --workspace=lean4-infoview-api --access=public
225+
226+
- name: Try publishing infoview
227+
continue-on-error: true
228+
run: npm publish --workspace=lean4-infoview --access=public
229+
230+
- name: Try publishing unicode-input
231+
continue-on-error: true
232+
run: npm publish --workspace=lean4-unicode-input --access=public
233+
234+
- name: Try publishing unicode-input-component
235+
continue-on-error: true
236+
run: npm publish --workspace=lean4-unicode-input-component --access=public
237+
238+
release:
239+
if: github.event_name == 'workflow_dispatch' && inputs.action == 'release'
240+
runs-on: ubuntu-latest
241+
steps:
242+
- name: Checkout
243+
uses: actions/checkout@v2
244+
with:
245+
fetch-depth: 0
246+
247+
- name: Compute next version
248+
id: version
249+
run: |
250+
last_tag="$(git tag --sort=-v:refname --list 'v*' --no-contains | head -1)"
251+
echo "Last tag: $last_tag"
252+
last_version="${last_tag#v}"
253+
last_version="${last_version%-pre}"
254+
new_version="$(echo "$last_version" | awk -F. '{$NF=$NF+1; print}' OFS=.)"
255+
echo "New version: $new_version"
256+
echo "new_version=$new_version" >> "$GITHUB_OUTPUT"
257+
258+
- name: Update version and create tag
259+
run: |
260+
new_version="${{ steps.version.outputs.new_version }}"
261+
sed -i 's/"version": ".*"/"version": "'$new_version'"/' vscode-lean4/package.json
262+
git config user.name "github-actions[bot]"
263+
git config user.email "github-actions[bot]@users.noreply.github.com"
264+
git commit -am "Release $new_version"
265+
git tag -a "v$new_version" -m "vscode-lean4 $new_version"
266+
267+
- name: Push
268+
run: |
269+
git push
270+
git push --tags
271+
272+
pre-release:
273+
if: github.event_name == 'workflow_dispatch' && inputs.action == 'pre-release'
274+
runs-on: ubuntu-latest
275+
steps:
276+
- name: Checkout
277+
uses: actions/checkout@v2
278+
with:
279+
fetch-depth: 0
280+
281+
- name: Compute next version
282+
id: version
283+
run: |
284+
last_tag="$(git tag --sort=-v:refname --list 'v*' --no-contains | head -1)"
285+
echo "Last tag: $last_tag"
286+
last_version="${last_tag#v}"
287+
last_version="${last_version%-pre}"
288+
new_version="$(echo "$last_version" | awk -F. '{$NF=$NF+1; print}' OFS=.)"
289+
echo "New version: $new_version"
290+
echo "new_version=$new_version" >> "$GITHUB_OUTPUT"
291+
292+
- name: Update version and create tag
293+
run: |
294+
new_version="${{ steps.version.outputs.new_version }}"
295+
sed -i 's/"version": ".*"/"version": "'$new_version'"/' vscode-lean4/package.json
296+
git config user.name "github-actions[bot]"
297+
git config user.email "github-actions[bot]@users.noreply.github.com"
298+
git commit -am "Release $new_version (pre-release)"
299+
git tag -a "v$new_version-pre" -m "vscode-lean4 $new_version (pre-release)"
300+
301+
- name: Push
302+
run: |
303+
git push
304+
git push --tags

.github/workflows/prerelease.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/publish-packages.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

lean4-infoview-api/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "@leanprover/infoview-api",
33
"version": "0.11.0",
44
"description": "Types and API for @leanprover/infoview.",
5-
"repository": "github:leanprover/vscode-lean4",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/leanprover/vscode-lean4.git"
8+
},
69
"scripts": {
710
"watch": "tsc --watch",
811
"watchTest": "tsc --watch",

lean4-infoview/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "@leanprover/infoview",
33
"version": "0.11.1",
44
"description": "An interactive display for the Lean 4 theorem prover.",
5-
"repository": "github:leanprover/vscode-lean4",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/leanprover/vscode-lean4.git"
8+
},
69
"scripts": {
710
"watch": "rollup --config --environment NODE_ENV:development --watch",
811
"build": "rollup --config --environment NODE_ENV:production",

lean4-unicode-input-component/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "@leanprover/unicode-input-component",
33
"version": "0.1.9",
44
"description": "Typescript support for contenteditable divs with the Unicode input support of the Lean 4 theorem prover",
5-
"repository": "github:leanprover/vscode-lean4",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/leanprover/vscode-lean4.git"
8+
},
69
"scripts": {
710
"watch": "tsc --watch",
811
"watchTest": "tsc --watch",

lean4-unicode-input/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "@leanprover/unicode-input",
33
"version": "0.1.9",
44
"description": "Unicode input mechanism for the Lean 4 theorem prover",
5-
"repository": "github:leanprover/vscode-lean4",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/leanprover/vscode-lean4.git"
8+
},
69
"scripts": {
710
"watch": "tsc --watch",
811
"watchTest": "tsc --watch",

0 commit comments

Comments
 (0)