Skip to content

Commit 2bcf88d

Browse files
committed
ci: use the same logic to determine build type for all releases
1 parent 3f238b3 commit 2bcf88d

File tree

1 file changed

+32
-17
lines changed

1 file changed

+32
-17
lines changed

Diff for: .github/workflows/release.yml

+32-17
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,32 @@ on:
1515
# Build on the oldest supported images, so we have broader compatibility
1616
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
1717
jobs:
18+
setup:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
build_type: ${{ steps.build.outputs.build_type }}
22+
appimage_tag: ${{ steps.build.outputs.appimage_tag }}
23+
steps:
24+
# Nightly uses RelWithDebInfo while stable uses Release (which disables
25+
# asserts). This helps get better debug info from people brave enough to
26+
# use the nightly builds.
27+
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
28+
run: |
29+
echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV
30+
echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV
31+
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
32+
run: |
33+
echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
34+
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
35+
- name: Export build information
36+
id: build
37+
run: |
38+
printf "build_type=${CMAKE_BUILD_TYPE}\n" >> $GITHUB_OUTPUT
39+
printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT
40+
1841
linux:
1942
runs-on: ubuntu-20.04
43+
needs: setup
2044
env:
2145
CC: gcc-10
2246
outputs:
@@ -27,16 +51,9 @@ jobs:
2751
# Perform a full checkout #13471
2852
fetch-depth: 0
2953
- run: ./.github/scripts/install_deps.sh
30-
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
31-
run: |
32-
echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV
33-
echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV
34-
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
35-
run: |
36-
echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
37-
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
54+
- run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV
3855
- name: appimage
39-
run: ./scripts/genappimage.sh ${APPIMAGE_TAG}
56+
run: ./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }}
4057
- name: tar.gz
4158
run: cpack --config build/CPackConfig.cmake -G TGZ
4259
- uses: actions/upload-artifact@v4
@@ -60,6 +77,7 @@ jobs:
6077
printf 'END\n' >> $GITHUB_OUTPUT
6178
6279
macos:
80+
needs: setup
6381
strategy:
6482
fail-fast: false
6583
matrix:
@@ -79,22 +97,18 @@ jobs:
7997
fetch-depth: 0
8098
- name: Install dependencies
8199
run: ./.github/scripts/install_deps.sh
82-
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
83-
run: printf 'CMAKE_BUILD_TYPE=Release\n' >> $GITHUB_ENV
84-
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
85-
run: printf 'CMAKE_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
86100

87101
- name: Build deps
88102
run: |
89103
cmake -S cmake.deps -B .deps -G Ninja \
90-
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
104+
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
91105
-D CMAKE_FIND_FRAMEWORK=NEVER
92106
cmake --build .deps
93107
94108
- name: Build neovim
95109
run: |
96110
cmake -B build -G Ninja \
97-
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
111+
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
98112
-D ENABLE_LIBINTL=OFF \
99113
-D CMAKE_FIND_FRAMEWORK=NEVER
100114
cmake --build build
@@ -109,6 +123,7 @@ jobs:
109123
retention-days: 1
110124

111125
windows:
126+
needs: setup
112127
runs-on: windows-2019
113128
steps:
114129
- uses: actions/checkout@v4
@@ -118,11 +133,11 @@ jobs:
118133
- run: .github/scripts/env.ps1
119134
- name: Build deps
120135
run: |
121-
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
136+
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
122137
cmake --build .deps
123138
- name: build package
124139
run: |
125-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
140+
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
126141
cmake --build build --target package
127142
- uses: actions/upload-artifact@v4
128143
with:

0 commit comments

Comments
 (0)