diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 21ce4e7e62..9a67f69059 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,8 @@ jobs: runs-on: ubuntu-18.04 steps: - name: PREVIOUS_TAG_NAME - run: echo "PREVIOUS_TAG_NAME=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)" >> $GITHUB_ENV + run: | + echo "PREVIOUS_TAG_NAME=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)" >> $GITHUB_ENV - name: TAG_NAME for schedule if: github.event_name == 'schedule' @@ -44,24 +45,28 @@ jobs: - draft: true + draft: false prerelease: true - name: RELEASE_BODY if: github.event_name == 'schedule' env: TAG_NAME: ${{ env.TAG_NAME }} - run: echo "RELEASE_BODY=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${TAG_NAME} | jq -r .body)" >> $GITHUB_ENV + run: | + echo 'RELEASE_BODY<> $GITHUB_ENV + echo $(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.TAG_NAME }} | jq -r .body | sed 's,",\\",g' | sed "s,',\\',g") >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV - name: RELEASE_ID if: github.event_name == 'schedule' env: TAG_NAME: ${{ env.TAG_NAME }} - run: echo "RELEASE_ID=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${TAG_NAME} | jq -r .id)" >> $GITHUB_ENV + run: | + echo "RELEASE_ID=$(curl -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.TAG_NAME }} | jq -r .id)" >> $GITHUB_ENV - name: GENERATED_NOTES if: github.event_name == 'schedule' - env: - TAG_NAME: ${{ env.TAG_NAME }} - PREVIOUS_TAG_NAME: ${{ env.PREVIOUS_TAG_NAME }} - run: echo "GENERATED_NOTES=$(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"'${TAG_NAME}'", "previous_tag_name":"'${PREVIOUS_TAG_NAME}'"}' | jq -r .body)" >> $GITHUB_ENV + run: | + echo 'GENERATED_NOTES<> $GITHUB_ENV + echo $(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"${{ env.TAG_NAME }}", "previous_tag_name":"${{ env.PREVIOUS_TAG_NAME }}"}' | jq -r .body | sed 's,",\\",g' | sed "s,',\\',g") >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV - name: Checkout code if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' ) @@ -238,4 +243,4 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }} \ - -d '{"draft":true, "body":"${{ env.RELEASE_BODY }}\n${{ env.GENERATED_NOTES }}"}' + -d '{"draft":false, "body":"${{ env.RELEASE_BODY }}\n${{ env.GENERATED_NOTES }}"}'