Skip to content

Commit 16e9a42

Browse files
committed
Only perform the pre-release build when there are changes.
- The pre-release build now runs by default daily - Only proceed when there are new changes to eclipse/lemminx or redhat-developer/vscode-xml Signed-off-by: Roland Grunberg <[email protected]>
1 parent 093a568 commit 16e9a42

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: release
22

33
on:
4+
schedule:
5+
- cron: '0 8 * * *'
46
workflow_dispatch:
57
inputs:
68
publishPreRelease:
@@ -28,7 +30,36 @@ on:
2830
- 'false'
2931
default: 'false'
3032
jobs:
33+
should-build-change:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
repo-cache-hit: ${{ steps.cache-last-commit.outputs.cache-hit }}
37+
steps:
38+
- uses: actions/checkout@v3
39+
with:
40+
repository: 'eclipse/lemminx'
41+
fetch-depth: 2
42+
path: lemminx
43+
- uses: actions/checkout@v3
44+
with:
45+
repository: 'redhat-developer/vscode-xml'
46+
fetch-depth: 2
47+
path: vscode-xml
48+
- run: |
49+
pushd lemminx
50+
git rev-parse HEAD >> ../lastCommit
51+
popd
52+
pushd vscode-xml
53+
git rev-parse HEAD >> ../lastCommit
54+
- name: Check New Changes
55+
id: cache-last-commit
56+
uses: actions/cache@v2
57+
with:
58+
path: lastCommit
59+
key: lastCommit-${{ hashFiles('lastCommit') }}
3160
build-binaries-job:
61+
needs: should-build-change
62+
if: ${{ needs.should-build-change.outputs.repo-cache-hit == 'false' || github.event_name != 'schedule' }}
3263
uses: rgrunber/vscode-xml/.github/workflows/native-image.yaml@main
3364
with:
3465
publishPreRelease: ${{ github.event_name == 'schedule' || inputs.publishPreRelease == 'true' }}

0 commit comments

Comments
 (0)