From f7fa376db3746f59df71e77290bd3dcd42e51431 Mon Sep 17 00:00:00 2001 From: OmgRod <89850217+OmgRod@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:33:32 +0100 Subject: [PATCH] Update workflows --- .github/workflows/update-mod.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/update-mod.yml diff --git a/.github/workflows/update-mod.yml b/.github/workflows/update-mod.yml new file mode 100644 index 0000000..cc9ed38 --- /dev/null +++ b/.github/workflows/update-mod.yml @@ -0,0 +1,36 @@ +name: Update Mod + +on: + release: + types: [published] + +jobs: + handle_new_release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Clone geode-sdk/cli repository + run: git clone https://github.com/geode-sdk/cli.git + + - name: Change directory to cli + working-directory: cli + run: cargo install --path . + + - name: Find the .geode attachment URL + id: find-attachment + run: | + attachment_url=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.assets[] | select(.name == "omgrod.geodify.geode") | .browser_download_url') + echo "::set-output name=url::$attachment_url" + + - name: Update mods using geode CLI + run: geode index mods update ${{ steps.find-attachment.outputs.url }} \ No newline at end of file