Nightly Build #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Build | |
on: | |
schedule: | |
- cron: '*/30 * * * *' # This schedule runs every night at midnight UTC | |
jobs: | |
nightly: | |
runs-on: self-hosted | |
steps: | |
- name: Ensure workspace ownership | |
run: echo "chown -R $USER $GITHUB_WORKSPACE" && sudo chown -R $USER $GITHUB_WORKSPACE | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Start builder container | |
run: | | |
TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}') | |
sudo docker rm -f infinity_build && sudo docker run -d --name infinity_build --network=host -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_build:0.1 | |
- name: Build release version | |
run: sudo docker exec infinity_build bash -c "cd /infinity && rm -fr cmake-build-release && mkdir -p cmake-build-release && cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -S /infinity -B /infinity/cmake-build-release && cmake --build /infinity/cmake-build-release" | |
- name: Build RPM and DEB | |
run: sudo docker exec infinity_build bash -c "cd /infinity/cmake-build-release && cpack" | |
- name: Create or overwrite a releae | |
# https://github.com/actions/upload-release-asset has been replaced by https://github.com/softprops/action-gh-release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.MY_GITHUB_TOKEN }} # Use the secret as an environment variable | |
prerelease: true | |
tag_name: nightly | |
files: | | |
cmake-build-release/infinity-*.deb | |
cmake-build-release/infinity-*.rpm | |
cmake-build-release/infinity-*.tar.gz |