From c399b50954c2780823cf9d8977f6cdbf723d1ddc Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 23 Apr 2024 22:24:51 -0400 Subject: [PATCH] ci: supporting installation using a remote repo instead of bundles --- .github/workflows/release-repo.yml | 63 ++++++++++++++++++++++++++++++ build.sh | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-repo.yml diff --git a/.github/workflows/release-repo.yml b/.github/workflows/release-repo.yml new file mode 100644 index 0000000..e0a86fe --- /dev/null +++ b/.github/workflows/release-repo.yml @@ -0,0 +1,63 @@ +name: Release + +on: + push: + branches: + - main + workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab + +concurrency: + group: '${{ github.workflow }} @ ${{ github.ref }}' + cancel-in-progress: false + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Checkout Flatpak repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: flatpak-repository + path: repo + - name: Setup GPG + id: import-gpg + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + git_config_global: true + git_user_signingkey: true + git_commit_gpgsign: true + - name: Install dependencies + run: | + DEBIAN_FRONTEND=noninteractive sudo apt-get update -y + git config --global protocol.file.allow always + sudo apt-get install --no-install-recommends -y \ + icoutils \ + flatpak \ + flatpak-builder \ + elfutils + flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + - name: Cache Flatpak builder + id: cache-flatpak-builder + uses: actions/cache@v4 + with: + path: .flatpak-builder + key: ${{ runner.os }}-flatpak-builder-${{ github.workflow }} + - name: Build Flatpak + run: | + ./build.sh sign + - name: Push Flatpak repository + run: | + cd repo + git add -A + git commit --signoff -m "Update com.jagexlauncher.JagexLauncher" + git reset $(git commit-tree HEAD^{tree} -m "Update com.jagexlauncher.JagexLauncher") + git push --progress -f origin flatpak-repository + env: + GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }} + GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }} + GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }} + GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }} \ No newline at end of file diff --git a/build.sh b/build.sh index bfec55a..76169af 100755 --- a/build.sh +++ b/build.sh @@ -4,4 +4,4 @@ cd icons cd .. flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo -flatpak-builder --install-deps-from=flathub --user --install --force-clean build-dir --disable-cache "$(basename $(git rev-parse --show-toplevel)).yml" \ No newline at end of file +flatpak-builder --repo ./repo --gpg-sign=787C55D80BC4CB5BB385FC67B9D5939A8F40EB05 --user --install --force-clean build-dir --disable-cache "$(basename $(git rev-parse --show-toplevel)).yml" \ No newline at end of file