From b683152fbf19ec0ce5ec1f9ed11b3673b878b7c0 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Thu, 7 Apr 2022 09:37:05 -0400 Subject: [PATCH] Fix `git describe --tags` not working in CI --- .github/workflows/check-builds.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-builds.yaml b/.github/workflows/check-builds.yaml index abaa109..babf551 100644 --- a/.github/workflows/check-builds.yaml +++ b/.github/workflows/check-builds.yaml @@ -23,9 +23,10 @@ jobs: - name: Set environment run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV shell: bash - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive + fetch-depth: 0 - name: Install dependencies run: sudo apt install clang cmake snap -y && sudo snap install powershell --classic - name: Check compilation @@ -61,9 +62,10 @@ jobs: - name: Set environment run: $s = $env:GITHUB_SHA.subString(0, 7); echo "SHORT_SHA=$s" >> $env:GITHUB_ENV shell: pwsh - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive + fetch-depth: 0 - name: Check compilation run: | $versions = "104", "728", "1013" @@ -116,15 +118,20 @@ jobs: BOT_SSH_KEY: ${{ secrets.BOT_SSH_KEY }} ENDPOINT: ${{ secrets.ENDPOINT }} steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 - run: mkdir ${{ github.sha }} - uses: actions/download-artifact@v3 with: path: ${{ github.sha }} - - name: Prepare artifacts + - name: Upload artifacts shell: bash run: | sudo apt install zip -y - cd ${{ github.sha }} + ARTDIR=$(git describe --tags) + cd $ARTDIR for build in *; do cd $build zip -r ../$build.zip * @@ -132,9 +139,6 @@ jobs: rm -r $build done cd .. - - name: Upload artifacts - shell: bash - run: | umask 077 printf %s "$BOT_SSH_KEY" > cdn_key - scp -i cdn_key -o StrictHostKeyChecking=no -r ${{ github.sha }} $ENDPOINT + scp -i cdn_key -o StrictHostKeyChecking=no -r $ARTDIR $ENDPOINT