mirror of
https://github.com/VibedByKaKi/yad.git
synced 2026-09-04 09:11:13 +02:00
Tags like v15.0 exist on the upstream repository but are not mirrored to this fork. Fall back to fetching tags from v1cont/yad when they are not found on origin. Co-authored-by: KaKi87 <KaKi87@pm.me>
173 lines
4.6 KiB
YAML
173 lines
4.6 KiB
YAML
# Builds upstream source from master whenever that branch is synced.
|
|
# Workflow and CI scripts live only on dev; dev must be the default branch.
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
inputs:
|
|
source_ref:
|
|
description: Upstream branch, tag (from v1cont/yad or this fork), or commit SHA on master
|
|
required: false
|
|
default: master
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: release-${{ github.event_name == 'workflow_dispatch' && format('manual-{0}', github.run_id) || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
SOURCE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || 'master' }}
|
|
CI_REF: dev
|
|
UPSTREAM_REPOSITORY: v1cont/yad
|
|
|
|
jobs:
|
|
build:
|
|
name: Build (${{ matrix.arch }})
|
|
runs-on: ${{ matrix.runner }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: amd64
|
|
runner: ubuntu-24.04
|
|
- arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: dev
|
|
fetch-depth: 0
|
|
|
|
- name: Prepare upstream source tree
|
|
run: .ci/checkout-source.sh
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
autoconf \
|
|
automake \
|
|
autotools-dev \
|
|
build-essential \
|
|
debhelper \
|
|
devscripts \
|
|
fakeroot \
|
|
gettext \
|
|
intltool \
|
|
libayatana-appindicator3-dev \
|
|
libgspell-1-dev \
|
|
libgtk-3-dev \
|
|
libgtksourceview-3.0-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
pkg-config
|
|
|
|
- name: Set package version
|
|
run: .ci/set-version.sh
|
|
|
|
- name: Build Debian package
|
|
env:
|
|
TARGET_ARCH: ${{ matrix.arch }}
|
|
run: .ci/build-deb.sh
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: yad-${{ matrix.arch }}
|
|
path: |
|
|
artifacts/*.deb
|
|
artifacts/yad-linux-*
|
|
artifacts/yad-tools-linux-*
|
|
artifacts/yad-icon-browser-linux-*
|
|
artifacts/yad-settings
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: Publish GitHub Release
|
|
needs: build
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: dev
|
|
fetch-depth: 0
|
|
|
|
- name: Prepare upstream source tree
|
|
run: .ci/checkout-source.sh
|
|
|
|
- name: Download build artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
pattern: yad-*
|
|
merge-multiple: true
|
|
|
|
- name: Set release metadata
|
|
run: |
|
|
UPSTREAM_VERSION="$(grep '^AC_INIT' configure.ac | sed -E 's/^AC_INIT\(\[[^]]+\], \[([^]]+)\].*/\1/')"
|
|
SHORT_SHA="$(git rev-parse --short=7 HEAD)"
|
|
TAG="v${UPSTREAM_VERSION}+git.${SHORT_SHA}"
|
|
TITLE="YAD ${UPSTREAM_VERSION} (${SHORT_SHA})"
|
|
{
|
|
echo "UPSTREAM_VERSION=${UPSTREAM_VERSION}"
|
|
echo "DEB_VERSION=${UPSTREAM_VERSION}-1+git${SHORT_SHA}"
|
|
echo "TAG=${TAG}"
|
|
echo "TITLE=${TITLE}"
|
|
} >> "$GITHUB_ENV"
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ env.TAG }}
|
|
name: ${{ env.TITLE }}
|
|
prerelease: true
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/*.deb
|
|
artifacts/yad-linux-*
|
|
artifacts/yad-tools-linux-*
|
|
artifacts/yad-icon-browser-linux-*
|
|
artifacts/yad-settings
|
|
|
|
apt:
|
|
name: Update APT repository
|
|
needs: release
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: dev
|
|
fetch-depth: 0
|
|
|
|
- name: Prepare upstream source tree
|
|
run: .ci/checkout-source.sh
|
|
|
|
- name: Download build artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
pattern: yad-*
|
|
merge-multiple: true
|
|
|
|
- name: Install APT repository tools
|
|
run: sudo apt-get update && sudo apt-get install -y reprepro gnupg
|
|
|
|
- name: Set package version
|
|
run: .ci/set-version.sh
|
|
|
|
- name: Update apt branch
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
APT_REPO_GPG_PRIVATE_KEY: ${{ secrets.APT_REPO_GPG_PRIVATE_KEY }}
|
|
run: .ci/update-apt-repo.sh
|