From fd56247fad63074a492eedebc6154d7e61aee1c4 Mon Sep 17 00:00:00 2001 From: reymondzzzz Date: Fri, 24 Nov 2023 13:11:23 +0300 Subject: [PATCH] update release action --- .github/workflows/release.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cabcef6..6c438c61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,16 +17,6 @@ jobs: version: ${{ steps.properties.outputs.version }} changelog: ${{ steps.properties.outputs.changelog }} steps: - - name: Set env CHANNEL - shell: bash - run: | - GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - if [[ ${GIT_BRANCH} == "main" ]]; then - echo "PUBLISH_CHANNEL=default" >> "$GITHUB_ENV" - else - echo "PUBLISH_CHANNEL=eap" >> "$GITHUB_ENV" - fi - # Free GitHub Actions Environment Disk Space - name: Maximize Build Space run: | @@ -39,7 +29,20 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} + + - name: Set env CHANNEL + shell: bash + run: | + raw=$(git branch -r --contains ${{ github.ref }}) + GIT_BRANCH=${raw##*/} + if [[ ${GIT_BRANCH} == "main" ]]; then + echo "PUBLISH_CHANNEL=default" >> "$GITHUB_ENV" + echo "PUBLISH_EAP=0" >> "$GITHUB_ENV" + else + echo "PUBLISH_CHANNEL=eap" >> "$GITHUB_ENV" + echo "PUBLISH_EAP=1" >> "$GITHUB_ENV" + fi + echo "GIT_BRANCH=${GIT_BRANCH}" >> "$GITHUB_ENV" - name: Download artifact id: download-artifact @@ -124,7 +127,7 @@ jobs: env: PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} PUBLISH_CHANNEL: ${{ env.PUBLISH_CHANNEL }} - PUBLISH_EAP: 1 + PUBLISH_EAP: 0 #${{ env.PUBLISH_EAP }} CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}