From 027d85c7cbc82647d85a0bf114a1753ba9e9d704 Mon Sep 17 00:00:00 2001 From: Daniel Inama <62436912+frostplexx@users.noreply.github.com> Date: Sat, 25 May 2024 11:48:05 +0200 Subject: [PATCH] Create publish_sparkle.yml --- .github/workflows/publish_sparkle.yml | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish_sparkle.yml diff --git a/.github/workflows/publish_sparkle.yml b/.github/workflows/publish_sparkle.yml new file mode 100644 index 0000000..606be3a --- /dev/null +++ b/.github/workflows/publish_sparkle.yml @@ -0,0 +1,41 @@ +name: Publish Sparkle Appcast + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Sparkle + uses: jozefizso/setup-sparkle@v1 + with: + version: 2.6.2 + + - name: Download release asset + id: download + run: | + gh release download ${{ github.event.release.tag_name }} --repo ${{ github.repository }} --pattern '*.dmg' --dir ./ + mv ./*.dmg lo-rain.dmg + + - name: Generate appcast + run: | + generate_keys & + generate_appcast ./ + sed -i "s|https://lo.cafe/lo-rain-files/lo-rain.dmg|https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/lo-rain.dmg|g" ./appcast.xml + + - name: Upload appcast.xml to repository + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git checkout main + cp ./appcast.xml $GITHUB_WORKSPACE/ + git add appcast.xml + git commit -m "Update appcast.xml for release ${{ github.event.release.tag_name }}" + git push