You've already forked bcmdhd-dkms
mirror of
https://github.com/armbian/bcmdhd-dkms.git
synced 2026-01-06 11:09:11 -08:00
add auto build workflow
This commit is contained in:
82
.github/workflows/release.yml
vendored
Normal file
82
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
name: Build & Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
- name: Build
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get build-dep --no-install-recommends -y .
|
||||
dpkg-buildpackage -us -uc
|
||||
- name: Workaround actions/upload-artifact#176
|
||||
run: |
|
||||
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}
|
||||
path: |
|
||||
${{ env.artifacts_path }}/*.deb
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}
|
||||
- name: Check if the latest version is releasable
|
||||
run: |
|
||||
version="$(dpkg-parsechangelog -S Version)"
|
||||
echo "version=$version" >> $GITHUB_ENV
|
||||
echo "changes<<EOF" >> $GITHUB_ENV
|
||||
echo '```' >> $GITHUB_ENV
|
||||
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
|
||||
echo '```' >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
if [[ -n "$(git tag -l "$version")" ]]
|
||||
then
|
||||
echo "distro=UNRELEASED" >> $GITHUB_ENV
|
||||
else
|
||||
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: Release
|
||||
if: env.distro != 'UNRELEASED'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.version }}
|
||||
body_path: README.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
target_commitish: main
|
||||
draft: false
|
||||
fail_on_unmatched_files: false
|
||||
files: |
|
||||
*.deb
|
||||
- name: Append changelog
|
||||
if: env.distro != 'UNRELEASED'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.version }}
|
||||
body: |
|
||||
## Changelog for ${{ env.version }}
|
||||
${{ env.changes }}
|
||||
append_body: true
|
||||
|
||||
Reference in New Issue
Block a user