From 19f541ee201296a9ce9be238a07fa5ab517df9d1 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 12 Jul 2024 18:22:04 +0100 Subject: [PATCH] Add custom build workflow --- .github/workflows/custom-build.yml | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/custom-build.yml diff --git a/.github/workflows/custom-build.yml b/.github/workflows/custom-build.yml new file mode 100644 index 0000000..60965ca --- /dev/null +++ b/.github/workflows/custom-build.yml @@ -0,0 +1,49 @@ +name: "Custom Build" + +"on": + workflow_dispatch: + inputs: + os: + description: "The runner label to use for the build" + required: false + type: string + default: "ubuntu-latest" + ghc: + description: "The version of GHC to use for the build" + required: false + type: string + resolver: + description: "The name of the resolver to use" + required: false + type: string + +jobs: + custom-build: + runs-on: ${{ inputs.os }} + + steps: + - name: "Clone repository" + uses: actions/checkout@v4 + + - name: "Remove existing Stack configuration" + shell: bash + run: | + # Remove custom.yaml if it exists + rm -f custom.yaml + + - name: "Write resolver" + if: inputs.resolver != '' + shell: bash + run: | + echo "resolver: ${{ inputs.resolver }}\n" >> custom.yaml + + - name: "Write ghc version" + if: inputs.ghc != '' + shell: bash + run: | + echo "compiler: ${{ inputs.ghc }}\n" >> custom.yaml + + - name: "Build with Stack (custom configuration)" + uses: mbg/actions/stack/build@v0.1 + with: + resolver: "custom"