Skip to content

Commit ee77b86

Browse files
committed
ci: use the same logic to determine build type for all releases
1 parent 036f86f commit ee77b86

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

Diff for: .github/workflows/release.yml

+30-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
@@ -79,22 +96,18 @@ jobs:
7996
fetch-depth: 0
8097
- name: Install dependencies
8198
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
8699

87100
- name: Build deps
88101
run: |
89102
cmake -S cmake.deps -B .deps -G Ninja \
90-
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
103+
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
91104
-D CMAKE_FIND_FRAMEWORK=NEVER
92105
cmake --build .deps
93106
94107
- name: Build neovim
95108
run: |
96109
cmake -B build -G Ninja \
97-
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
110+
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
98111
-D ENABLE_LIBINTL=OFF \
99112
-D CMAKE_FIND_FRAMEWORK=NEVER
100113
cmake --build build
@@ -118,11 +131,11 @@ jobs:
118131
- run: .github/scripts/env.ps1
119132
- name: Build deps
120133
run: |
121-
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
134+
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
122135
cmake --build .deps
123136
- name: build package
124137
run: |
125-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
138+
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
126139
cmake --build build --target package
127140
- uses: actions/upload-artifact@v4
128141
with:

0 commit comments

Comments
 (0)