chore: add COPR publish workflow
This commit is contained in:
parent
7b95412511
commit
2378f74e58
5 changed files with 108 additions and 1 deletions
60
.github/workflows/copr_publish.yml
vendored
Normal file
60
.github/workflows/copr_publish.yml
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
name: Publish COPR Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag (e.g. oneclient-2.0.1)'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
resolve:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.parse.outputs.version }}
|
||||
steps:
|
||||
- name: Parse release tag
|
||||
id: parse
|
||||
run: |
|
||||
TAG="${{ github.event.release.tag_name || inputs.tag }}"
|
||||
if [[ "$TAG" =~ ^oneclient-(.+)$ ]]; then
|
||||
echo "version=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "::error::Tag '$TAG' does not match oneclient-*"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
publish-bin:
|
||||
needs: resolve
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:latest
|
||||
steps:
|
||||
- name: Install tooling
|
||||
run: dnf -y install rpm-build rpmdevtools copr-cli bsdtar git
|
||||
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||
|
||||
- name: Prepare spec
|
||||
env:
|
||||
VERSION: ${{ needs.resolve.outputs.version }}
|
||||
run: |
|
||||
SPEC="distribution/copr/oneclient-bin.spec"
|
||||
sed -i "s/^Version:.*/Version: ${VERSION}/" "$SPEC"
|
||||
sed -i "s/^Release:.*/Release: 1%{?dist}/" "$SPEC"
|
||||
|
||||
- name: Build SRPM
|
||||
run: |
|
||||
rpmdev-setuptree
|
||||
spectool -g -R distribution/copr/oneclient-bin.spec
|
||||
rpmbuild -bs distribution/copr/oneclient-bin.spec
|
||||
|
||||
- name: Submit to COPR
|
||||
env:
|
||||
COPR_CONFIG_CONTENT: ${{ secrets.COPR_CONFIG }}
|
||||
run: |
|
||||
mkdir -p ~/.config
|
||||
printf '%s' "$COPR_CONFIG_CONTENT" > ~/.config/copr
|
||||
chmod 600 ~/.config/copr
|
||||
copr-cli build polyfrost/OneClient ~/rpmbuild/SRPMS/oneclient-bin-*.src.rpm
|
||||
2
.github/workflows/oneclient_nightly.yml
vendored
2
.github/workflows/oneclient_nightly.yml
vendored
|
|
@ -189,6 +189,8 @@ jobs:
|
|||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cp target/release/.cargo-packager/deb/*/data/usr/share/applications/oneclient_app.desktop \
|
||||
target/release/oneclient_app.desktop
|
||||
cargo generate-rpm -p packages/oneclient_app
|
||||
cp target/generate-rpm/*.rpm "${{ steps.outdir.outputs.dir }}/"
|
||||
|
||||
|
|
|
|||
2
.github/workflows/oneclient_release.yml
vendored
2
.github/workflows/oneclient_release.yml
vendored
|
|
@ -407,6 +407,8 @@ jobs:
|
|||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cp target/release/.cargo-packager/deb/*/data/usr/share/applications/oneclient_app.desktop \
|
||||
target/release/oneclient_app.desktop
|
||||
cargo generate-rpm -p packages/oneclient_app
|
||||
cp target/generate-rpm/*.rpm "${{ steps.outdir.outputs.dir }}/"
|
||||
|
||||
|
|
|
|||
43
distribution/copr/oneclient-bin.spec
Normal file
43
distribution/copr/oneclient-bin.spec
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
%global debug_package %{nil}
|
||||
%global __strip /bin/true
|
||||
%global _appname OneClient
|
||||
%global _rpmfile %{_appname}_%{version}_linux_x86_64.rpm
|
||||
|
||||
Name: oneclient-bin
|
||||
Version: 2.0.1
|
||||
Release: 1%{?dist}
|
||||
Summary: Next-generation open source Minecraft launcher (prebuilt)
|
||||
|
||||
License: GPL-3.0-only
|
||||
URL: https://github.com/Polyfrost/OneLauncher
|
||||
Source0: %{url}/releases/download/oneclient-%{version}/%{_rpmfile}
|
||||
|
||||
ExclusiveArch: x86_64
|
||||
BuildRequires: bsdtar
|
||||
Requires: gtk3
|
||||
Requires: dbus-libs
|
||||
Provides: oneclient = %{version}-%{release}
|
||||
|
||||
%description
|
||||
OneClient is a next-generation open source Minecraft launcher.
|
||||
This package ships the prebuilt binaries from the upstream release.
|
||||
|
||||
%prep
|
||||
%setup -q -c -T
|
||||
# Repackages the upstream release rpm; bsdtar reads its cpio payload directly.
|
||||
bsdtar -xf %{SOURCE0}
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}
|
||||
cp -a usr %{buildroot}/
|
||||
ln -s oneclient_app %{buildroot}%{_bindir}/oneclient
|
||||
|
||||
%files
|
||||
%{_bindir}/oneclient_app
|
||||
%{_bindir}/oneclient
|
||||
%{_datadir}/applications/*.desktop
|
||||
%{_datadir}/icons/hicolor/*/apps/*
|
||||
|
||||
%changelog
|
||||
* Wed Sep 09 2026 Polyfrost <contact@atmofrost.org> - 2.0.1-1
|
||||
- See upstream release notes.
|
||||
|
|
@ -155,7 +155,7 @@ desktop-template = "distribution/linux/org.polyfrost.oneclient.template"
|
|||
auto-req = "builtin"
|
||||
assets = [
|
||||
{ source = "target/release/oneclient_app", dest = "/usr/bin/oneclient_app", mode = "755" },
|
||||
{ source = "target/release/.cargo-packager/deb/*/data/usr/share/applications/oneclient_app.desktop", dest = "/usr/share/applications/", mode = "644" },
|
||||
{ source = "target/release/oneclient_app.desktop", dest = "/usr/share/applications/oneclient_app.desktop", mode = "644" },
|
||||
{ source = "icons/32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/oneclient_app.png", mode = "644" },
|
||||
{ source = "icons/64x64.png", dest = "/usr/share/icons/hicolor/64x64/apps/oneclient_app.png", mode = "644" },
|
||||
{ source = "icons/128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/oneclient_app.png", mode = "644" },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue