Skip to content

Commit 38b1e9b

Browse files
feat: add the workflow to release the installing package for macos (#2028)
* feat: add the workflow to release the installing package of macos automatically when a new tag created Signed-off-by: mango <[email protected]> * remove step of unit tests Signed-off-by: mango <[email protected]> * remove step of unit tests Signed-off-by: mango <[email protected]> * rename OPENMLDB_PREFIX Signed-off-by: mango <[email protected]> * fix prepare error Signed-off-by: mango <[email protected]> * only runs it if is a tag push Signed-off-by: mango <[email protected]> * add a macos-release flow Signed-off-by: mango <[email protected]> * update dependency Signed-off-by: mango <[email protected]>
1 parent b0aaea8 commit 38b1e9b

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

.github/workflows/cicd.yaml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,66 @@ jobs:
141141
check_name: Linux Test Report
142142
comment_title: Linux Test Report
143143

144+
macos-cpp:
145+
runs-on: macos-latest
146+
if: github.repository == '4paradigm/OpenMLDB' && startsWith(github.ref, 'refs/tags/v')
147+
env:
148+
OS: darwin
149+
ARCH: x86_64
150+
NPROC: 3
151+
CTEST_PARALLEL_LEVEL: 1 # parallel test level for ctest (make test)
152+
steps:
153+
- uses: actions/checkout@v2
154+
155+
- name: prepare release
156+
run: |
157+
VERSION="snapshot"
158+
if [[ ${{ github.ref }} == "refs/tags/v"* ]]; then
159+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
160+
VERSION=${VERSION#v}
161+
bash steps/prepare_release.sh "$VERSION"
162+
fi
163+
echo "OPENMLDB_PREFIX=openmldb-$VERSION-darwin" >> $GITHUB_ENV
164+
165+
- name: enable java on release
166+
if: github.event_name == 'push'
167+
run: |
168+
echo "SQL_JAVASDK_ENABLE=ON" >> $GITHUB_ENV
169+
170+
- name: configure
171+
env:
172+
SQL_JAVASDK_ENABLE: ${{ env.SQL_JAVASDK_ENABLE }}
173+
run: |
174+
make configure CMAKE_INSTALL_PREFIX=${{ env.OPENMLDB_PREFIX }}
175+
176+
- name: build
177+
run: |
178+
make build
179+
# GitHub runner disk space is limited
180+
# delete thirdparty build directory($ROOT/.deps/) to save disk space
181+
# make thirdpartybuild-clean
182+
183+
- name: install
184+
if: ${{ github.event_name == 'push' }}
185+
run: |
186+
make install
187+
188+
- name: package
189+
if: ${{ github.event_name == 'push' }}
190+
run: |
191+
tar czf ${{ env.OPENMLDB_PREFIX }}.tar.gz ${{ env.OPENMLDB_PREFIX }}/
192+
193+
- name: upload artifacts
194+
if: ${{ github.event_name == 'push' }}
195+
uses: actions/upload-artifact@v2
196+
with:
197+
path: openmldb-*.tar.gz
198+
name: release-artifacts
199+
144200
release:
145201
runs-on: ubuntu-latest
146202
# if test failed, shouldn't release
147-
needs: [ "cpp" ]
203+
needs: [ "cpp", "macos-cpp" ]
148204
if: >
149205
success() && startsWith(github.ref, 'refs/tags/v')
150206
steps:

0 commit comments

Comments
 (0)