Skip to content

Nightly Build

Nightly Build #10

Workflow file for this run

name: Nightly Build
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
nightly-build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Cache Premake5
id: cache-premake
uses: actions/cache@v4
with:
path: /usr/local/bin/premake5
key: ${{ runner.os }}-premake5-0.0.alpha16
- name: Cache build
uses: actions/cache@v4
with:
path: |
output/
obj/
key: ${{ runner.os }}-build-${{ hashFiles('**/*.cpp', '**/*.h', 'premake5.lua') }}
restore-keys: |
${{ runner.os }}-build-
- name: Download GCC
run: sudo apt-get install -y gcc make
- name: Download Premake5
if: steps.cache-premake.outputs.cache-hit != 'true'
run: |
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha16/premake-5.0.0-alpha16-linux.tar.gz
tar -xzvf premake-5.0.0-alpha16-linux.tar.gz
sudo mv premake5 /usr/local/bin/
- name: Generate project files
run: premake5 gmake
- name: Build the project
run: make config=release -j -B
- name: Determine tag name
id: tag
run: |
TAG_COUNT=$(git tag | wc -l | tr -d ' ')
LAST_TAG=$(git rev-list --tags --no-walk --max-count=1)
if [ -z "$LAST_TAG" ]; then
COMMIT_COUNT=$(git rev-list --count HEAD)
else
COMMIT_COUNT=$(git rev-list "$LAST_TAG"..HEAD --count)
fi
TAG_NAME="v$TAG_COUNT.$COMMIT_COUNT.nightly"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
git tag "$TAG_NAME"
git push origin "$TAG_NAME"
- name: Upload nightly build artifact
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG_NAME }}
files: ./output/bin/basm/basm
generate_release_notes: true