From e3e0998095ba5edc30bb2ac4638f2372646ed721 Mon Sep 17 00:00:00 2001 From: thespad Date: Wed, 11 Sep 2024 17:28:43 +0100 Subject: [PATCH 1/2] Add v2 sample workflow --- .github/workflows/BuildImage.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 6008e85..360333f 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -1,12 +1,20 @@ name: Build Image -on: [push, pull_request_target, workflow_dispatch] +on: + push: + pull_request_target: + workflow_dispatch: + inputs: + mod_version: + type: string + required: false env: GITHUB_REPO: "linuxserver/docker-mods" #don't modify ENDPOINT: "linuxserver/mods" #don't modify BASEIMAGE: "replace_baseimage" #replace MODNAME: "replace_modname" #replace + MOD_VERSION: ${{ inputs.mod_version }} #don't modify MULTI_ARCH: "true" #set to false if not needed jobs: @@ -21,8 +29,13 @@ jobs: echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT - # **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. **** - MOD_VERSION="" + if [[ -z "${{ env.MOD_VERSION }}" ]]; then + # **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. **** + MOD_VERSION="" + else + MOD_VERSION=${{ env.MOD_VERSION }} + echo "MOD_VERSION_OVERRIDE=true" >> $GITHUB_OUTPUT + fi echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT outputs: GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }} @@ -31,9 +44,10 @@ jobs: MODNAME: ${{ steps.outputs.outputs.MODNAME }} MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }} MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }} + MOD_VERSION_OVERRIDE: ${{ steps.outputs.outputs.MOD_VERSION_OVERRIDE }} build: - uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1 + uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v2 needs: set-vars secrets: CR_USER: ${{ secrets.CR_USER }} @@ -47,3 +61,4 @@ jobs: MODNAME: ${{ needs.set-vars.outputs.MODNAME }} MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }} MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }} + MOD_VERSION_OVERRIDE: ${{ needs.set-vars.outputs.MOD_VERSION_OVERRIDE }} From 71ed9ae65ee8681e77bcd5debebc404534359c80 Mon Sep 17 00:00:00 2001 From: thespad Date: Wed, 11 Sep 2024 19:25:59 +0100 Subject: [PATCH 2/2] Update workflow version --- .github/workflows/BuildImage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 360333f..4715e56 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -47,7 +47,7 @@ jobs: MOD_VERSION_OVERRIDE: ${{ steps.outputs.outputs.MOD_VERSION_OVERRIDE }} build: - uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v2 + uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1 needs: set-vars secrets: CR_USER: ${{ secrets.CR_USER }}