Skip to content

Build Debian package #535

Build Debian package

Build Debian package #535

Workflow file for this run

---
name: Build Debian package
on:
schedule:
- cron: '5 5 * * *'
push:
branches:
- master
jobs:
build:
name: "Build Debian package from nav/master"
runs-on: ubuntu-latest
env:
DEBEMAIL: '[email protected]'
DEBFULLNAME: 'Automated GitHub build'
NONINTERACTIVE: '1'
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Make pip cache directories
run: |
mkdir -p $HOME/.cache
mkdir -p $HOME/.pip
- name: Cache pip packages
uses: actions/cache@v3
id: pip-cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Branch name
run: |
echo Running on ${GITHUB_REF##*/}
- name: Merge latest upstream
run: |
git config --global user.email "$DEBEMAIL"
git config --global user.name "$DEBFULLNAME"
git remote add upstream https://github.com/Uninett/nav
git branch --force cibuild ${GITHUB_REF##*/}
git checkout cibuild
git config pull.rebase false
git pull upstream master
- name: Build Docker image
run: |
cd debian; ./dev.sh /bin/true
- name: Add changelog entry
run: |
cd debian; ./dch.sh -v $(git describe upstream/master)-1 "Automated build" && ./dch.sh -r "Automated build"
- name: Build package
run: |
cd debian; ./build.sh
- name: Prepare package artifacts
run: |
mkdir ${GITHUB_RUN_ID}
mv ../nav_* ${GITHUB_RUN_ID}/
- name: Upload package artifacts
uses: actions/upload-artifact@v3
with:
name: Debian package from NAV master branch
path: |
${{ github.run_id }}/nav_*