Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Prosvetova <anna@prosvetova.me>2021-08-20 20:31:07 +0300
committerGitHub <noreply@github.com>2021-08-20 20:31:07 +0300
commitb1bbf1730c5626bc84fb9794a96fe921a115f83c (patch)
tree054bb2eedf9da9dcef1a07486190e765d227802a /.github
parent54278b9adc156337fa21243a50c835c235d94e91 (diff)
CI: Fix branch names (#664)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml27
1 files changed, 18 insertions, 9 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index baef8fe1..0a973908 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -47,14 +47,23 @@ jobs:
run: |
test -d artifacts && rm -rf artifacts || true
mkdir artifacts
-
- - name: 'Generate tag suffix'
- if: startsWith(github.ref, 'refs/tags/') == true
- run: echo "SUFFIX=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
-
- - name: 'Generate branch suffix'
- if: startsWith(github.ref, 'refs/tags/') != true
- run: echo "SUFFIX=$(git rev-parse --abbrev-ref HEAD)-$(date +'%d%m%Y')-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
+
+ - name: 'Generate suffix and folder name'
+ run: |
+ REF=${{ github.ref }}
+ if [[ ${{ github.event_name }} == 'pull_request' ]]; then
+ REF=${{ github.head_ref }}
+ fi
+ REF=${REF##*/}
+
+ if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
+ SUFFIX=${REF}
+ else
+ SUFFIX=${REF}-$(date +'%d%m%Y')-$(echo ${GITHUB_SHA} | cut -c1-8)
+ fi
+
+ echo "SUFFIX=${SUFFIX}" >> $GITHUB_ENV
+ echo "ARTIFACTS_PATH=${REF}" >> $GITHUB_ENV
- name: 'Build bootloader in docker'
uses: ./.github/actions/docker
@@ -178,7 +187,7 @@ jobs:
with:
switches: -avzP --delete
path: artifacts/
- remote_path: "${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${GITHUB_REF##*/}/"
+ remote_path: "${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${ARTIFACTS_PATH}/"
remote_host: ${{ secrets.RSYNC_DEPLOY_HOST }}
remote_port: ${{ secrets.RSYNC_DEPLOY_PORT }}
remote_user: ${{ secrets.RSYNC_DEPLOY_USER }}