From 2c78c731f7fcc62f39736f02c4803ddb9f5285f3 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Fri, 30 Jun 2023 14:23:17 +0200 Subject: [PATCH] Build Elixir main docs with ExDoc main (#12736) --- .github/workflows/release_pre_built/action.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release_pre_built/action.yml b/.github/workflows/release_pre_built/action.yml index dcd5c06640..2ed8a403d5 100644 --- a/.github/workflows/release_pre_built/action.yml +++ b/.github/workflows/release_pre_built/action.yml @@ -36,17 +36,21 @@ runs: mv lib/elixir/scripts/windows_installer/tmp/elixir-otp-${{ inputs.otp }}.exe . shasum -a 1 elixir-otp-${{ inputs.otp }}.exe > elixir-otp-${{ inputs.otp }}.exe.sha1sum shasum -a 256 elixir-otp-${{ inputs.otp }}.exe > elixir-otp-${{ inputs.otp }}.exe.sha256sum - - name: Get latest stable ExDoc version - if: ${{ inputs.build_docs }} + - name: Get ExDoc ref + if: ${{ inputs.build_docs && github.ref_name != "main" }} shell: bash run: | - EX_DOC_LATEST_STABLE_VERSION=$(curl -s https://hex.pm/api/packages/ex_doc | jq --raw-output '.latest_stable_version') - echo "EX_DOC_LATEST_STABLE_VERSION=${EX_DOC_LATEST_STABLE_VERSION}" >> $GITHUB_ENV + if [ "${{ github.ref_name }}" = "main" ]; then + ref=main + else + ref=v$(curl -s https://hex.pm/api/packages/ex_doc | jq --raw-output '.latest_stable_version') + fi + echo "EX_DOC_REF=$ref" >> $GITHUB_ENV - uses: actions/checkout@v3 if: ${{ inputs.build_docs }} with: repository: elixir-lang/ex_doc - ref: v${{ env.EX_DOC_LATEST_STABLE_VERSION }} + ref: ${{ env.EX_DOC_REF }} path: ex_doc - name: Build ex_doc if: ${{ inputs.build_docs }}