Skip to content

Build image

Build image #942

Workflow file for this run

name: Build image
on:
# Allow manual runs of workflow from Actions tab
workflow_dispatch:
inputs:
version-bump:
description: Version bump
required: true
type: choice
options:
- Auto
- Major
- Minor
- Patch
- RC
- Dev
- Release
default: Auto
schedule:
- cron: '37 5 * * *'
push:
branches:
- force-build
jobs:
build:
runs-on: 'ubuntu-22.04'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Build image
id: build-image
run: |
last_commit_date=$(git log -1 --format=%cd --date=unix)
last_day=$(date -d '-1 day' +%s)
if [ "${last_commit_date}" -lt "${last_day}" ]; then
echo "Nothig new to build."
echo "Last commit:"
git log -1 --format='%C(auto)%h (%cd) - %s' --date=relative
exit 0
fi
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
sudo ./build-docker.sh -v ${{ github.event.inputs.version-bump }}
- name: Upload image
uses: actions/upload-artifact@v3
with:
name: wlanpi-nightly-release-${{ steps.build-image.outputs.version }}
path: deploy/*.zip
- name: Upload image info
uses: actions/upload-artifact@v3
with:
name: wlanpi-nightly-release-${{ steps.build-image.outputs.version }}-info
path: deploy/*.info
- name: Create Pre-Release
if: ${{ github.event.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.build-image.outputs.version }}
prerelease: true
files: |
deploy/*.zip
deploy/*.info
deploy/wlanpi-os/os.json
- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
with:
name: wlanpi-nightly-release-${{ steps.build-image.outputs.version }}-buildlogs
path: deploy/*.log
slack-workflow-status:
if: always()
name: Post Workflow Status to Slack
needs:
- build
runs-on: 'ubuntu-22.04'
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
channel: '#pi-gen'
name: 'WLAN Pi CI Bot'