42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
# Builds the .deb when a version tag is pushed and publishes it as a release,
|
|
# with that version's CHANGELOG.md section as the release notes. To release,
|
|
# set VERSION and CHANGELOG.md, commit, then:
|
|
# git tag v$(cat VERSION) && git push origin v$(cat VERSION)
|
|
name: release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
jobs:
|
|
deb:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check that the tag matches VERSION
|
|
run: |
|
|
if [ "$GITHUB_REF_NAME" != "v$(cat VERSION)" ]; then
|
|
echo "tag $GITHUB_REF_NAME doesn't match VERSION ($(cat VERSION))"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Install build tools
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
run: |
|
|
SUDO=$(command -v sudo || true)
|
|
$SUDO apt-get update -qq
|
|
$SUDO apt-get install -y -qq make python3 dpkg shellcheck python3-pyflakes
|
|
|
|
- name: Build (make check runs first)
|
|
run: make deb
|
|
|
|
- name: Publish the release
|
|
env:
|
|
GITEA_URL: ${{ gitea.server_url }}
|
|
GITEA_REPO: ${{ gitea.repository }}
|
|
# The job's own token; set a RELEASE_TOKEN secret instead if it isn't allowed to write releases
|
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITEA_TOKEN }}
|
|
run: python3 packaging/gitea-release.py "$GITHUB_REF_NAME" build/*.deb
|