feat(ci): add nightly build workflow (#129)
- Adds scheduled daily builds at 2 AM UTC - Builds Python packages and uploads as artifacts - 7-day retention to keep storage minimal - No release tab pollution - artifacts only
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
name: Nightly Build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
nightly:
|
||||
name: Build and Upload Nightly
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
portaudio19-dev \
|
||||
python3-dev \
|
||||
libgirepository1.0-dev \
|
||||
pkg-config
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel build twine
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python -m build
|
||||
ls -la dist/
|
||||
|
||||
- name: Generate nightly version
|
||||
id: version
|
||||
run: |
|
||||
NIGHTLY_VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' src/vocalinux/version.py)
|
||||
DATE=$(date +%Y%m%d)
|
||||
echo "version=${NIGHTLY_VERSION}.dev${DATE}" >> $GITHUB_OUTPUT
|
||||
echo "Built version: ${NIGHTLY_VERSION}.dev${DATE}"
|
||||
|
||||
- name: Rename artifacts
|
||||
run: |
|
||||
for file in dist/*; do
|
||||
base=$(basename "$file")
|
||||
mv "$file" "dist/nightly-${base#vocalinux-}"
|
||||
done
|
||||
ls -la dist/
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vocalinux-nightly-${{ steps.version.outputs.version }}
|
||||
path: dist/
|
||||
retention-days: 7
|
||||
Reference in New Issue
Block a user