From 2378f74e58b5dee321b76422b4e402d5874b904a Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Wed, 9 Sep 2026 01:54:23 +0200 Subject: [PATCH] chore: add COPR publish workflow --- .github/workflows/copr_publish.yml | 60 +++++++++++++++++++++++++ .github/workflows/oneclient_nightly.yml | 2 + .github/workflows/oneclient_release.yml | 2 + distribution/copr/oneclient-bin.spec | 43 ++++++++++++++++++ packages/oneclient_app/Cargo.toml | 2 +- 5 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/copr_publish.yml create mode 100644 distribution/copr/oneclient-bin.spec diff --git a/.github/workflows/copr_publish.yml b/.github/workflows/copr_publish.yml new file mode 100644 index 00000000..29e43a37 --- /dev/null +++ b/.github/workflows/copr_publish.yml @@ -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 diff --git a/.github/workflows/oneclient_nightly.yml b/.github/workflows/oneclient_nightly.yml index c73906df..657cbb10 100644 --- a/.github/workflows/oneclient_nightly.yml +++ b/.github/workflows/oneclient_nightly.yml @@ -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 }}/" diff --git a/.github/workflows/oneclient_release.yml b/.github/workflows/oneclient_release.yml index 1ad5909d..fec605a1 100644 --- a/.github/workflows/oneclient_release.yml +++ b/.github/workflows/oneclient_release.yml @@ -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 }}/" diff --git a/distribution/copr/oneclient-bin.spec b/distribution/copr/oneclient-bin.spec new file mode 100644 index 00000000..4edf422c --- /dev/null +++ b/distribution/copr/oneclient-bin.spec @@ -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 - 2.0.1-1 +- See upstream release notes. diff --git a/packages/oneclient_app/Cargo.toml b/packages/oneclient_app/Cargo.toml index 6f7d3a0c..dbc663f5 100644 --- a/packages/oneclient_app/Cargo.toml +++ b/packages/oneclient_app/Cargo.toml @@ -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" },