From acebbeed1674c26cfc004146eabbeeeb1c63d06d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 15 Mar 2023 20:59:36 +0000 Subject: [PATCH] Added version channels for update.pmmp.io --- .github/workflows/update-updater-api.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-updater-api.yml b/.github/workflows/update-updater-api.yml index dc40d17e9..906278ef3 100644 --- a/.github/workflows/update-updater-api.yml +++ b/.github/workflows/update-updater-api.yml @@ -25,13 +25,25 @@ jobs: - name: Download new release information run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json - - name: Detect channel + - name: Detect channels id: channel - run: echo CHANNEL=$(jq -r '.channel' new_build_info.json) >> $GITHUB_OUTPUT - - - name: Copy release information run: | - cp new_build_info.json channels/${{ steps.channel.outputs.CHANNEL }}.json + CHANNEL=$(jq -r '.channel' new_build_info.json) + VERSION=${{ steps.tag-name.outputs.TAG_NAME }} + echo CHANNEL=$CHANNEL >> $GITHUB_OUTPUT + if [ "$CHANNEL" == "stable" ]; then + echo MAJOR=$(echo $VERSION | cut -d. -f1) >> $GITHUB_OUTPUT + echo MINOR=$(echo $VERSION | cut -d. -f1-2) >> $GITHUB_OUTPUT + else + echo MAJOR=$(echo $VERSION | cut -d. -f1)-$CHANNEL >> $GITHUB_OUTPUT + echo MINOR=$(echo $VERSION | cut -d. -f1-2)-$CHANNEL >> $GITHUB_OUTPUT + fi + + - name: Update channel info + run: | + cp new_build_info.json "channels/${{ steps.channel.outputs.CHANNEL }}.json" + cp new_build_info.json "channels/${{ steps.channel.outputs.MAJOR }}.json" + cp new_build_info.json "channels/${{ steps.channel.outputs.MINOR }}.json" rm new_build_info.json - name: Commit changes