Build misc packages #45
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: Build misc packages | |
on: | |
# Allow manual runs of workflow from Actions tab | |
workflow_dispatch: | |
inputs: | |
packages: | |
description: Packages to build | |
required: true | |
type: choice | |
options: | |
- all | |
- iw | |
- wlanpi-linux-firmware | |
default: all | |
jobs: | |
build: | |
name: package ${{ matrix.package }}+${{ matrix.arch }} | |
runs-on: 'ubuntu-22.04' | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [bullseye] | |
package: [iw,wlanpi-linux-firmware] | |
arch: [armhf,arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -yqq | |
sudo apt-get install -yqq --no-install-recommends \ | |
git bc bison flex libssl-dev make libc6-dev libncurses5-dev devscripts \ | |
libdistro-info-perl | |
sudo apt-get install -yqq --no-install-recommends \ | |
crossbuild-essential-armhf crossbuild-essential-arm64 | |
- name: Build package ${{ matrix.package }} | |
id: build-package | |
run: | | |
./package.sh --arch=${{ matrix.arch }} --package=${{ matrix.package }} | |
- name: Upload package ${{ matrix.package }} | |
uses: actions/upload-artifact@v3 | |
if: ${{ steps.build-package.outputs.deb-package != '' }} | |
with: | |
name: ${{ matrix.package }}-${{ matrix.arch }}-${{ steps.build-package.outputs.package-version }} | |
path: ${{ steps.build-package.outputs.deb-package }} | |
- name: Upload armhf package to raspbian/${{ matrix.distro }} | |
if: matrix.arch == 'armhf' | |
uses: danielmundi/upload-packagecloud@main | |
with: | |
package-name: ${{ steps.build-package.outputs.deb-package }} | |
packagecloud-username: wlanpi | |
packagecloud-repo: dev | |
packagecloud-distrib: raspbian/${{ matrix.distro }} | |
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
- name: Upload arm64 package to debian/${{ matrix.distro }} | |
if: matrix.arch == 'arm64' | |
uses: danielmundi/upload-packagecloud@main | |
with: | |
package-name: ${{ steps.build-package.outputs.deb-package }} | |
packagecloud-username: wlanpi | |
packagecloud-repo: dev | |
packagecloud-distrib: debian/${{ matrix.distro }} | |
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
if: ${{ steps.build-package.outputs.deb-package != '' }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
add-paths: debians | |
branch: update-changelog | |
branch-suffix: timestamp | |
delete-branch: true | |
title: Update changelog for ${{ matrix.package }} version ${{ steps.build-package.outputs.package-version }} | |
body: Package ${{ matrix.package }} built on version ${{ steps.build-package.outputs.package-version }}. | |
assignees: danielmundi | |
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 }} |