Fix git describe --tags not working in CI

This commit is contained in:
gsemaj 2022-04-07 09:37:05 -04:00
parent 86576d48f6
commit b683152fbf

View File

@ -23,9 +23,10 @@ jobs:
- name: Set environment - name: Set environment
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
shell: bash shell: bash
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: sudo apt install clang cmake snap -y && sudo snap install powershell --classic run: sudo apt install clang cmake snap -y && sudo snap install powershell --classic
- name: Check compilation - name: Check compilation
@ -61,9 +62,10 @@ jobs:
- name: Set environment - name: Set environment
run: $s = $env:GITHUB_SHA.subString(0, 7); echo "SHORT_SHA=$s" >> $env:GITHUB_ENV run: $s = $env:GITHUB_SHA.subString(0, 7); echo "SHORT_SHA=$s" >> $env:GITHUB_ENV
shell: pwsh shell: pwsh
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
fetch-depth: 0
- name: Check compilation - name: Check compilation
run: | run: |
$versions = "104", "728", "1013" $versions = "104", "728", "1013"
@ -116,15 +118,20 @@ jobs:
BOT_SSH_KEY: ${{ secrets.BOT_SSH_KEY }} BOT_SSH_KEY: ${{ secrets.BOT_SSH_KEY }}
ENDPOINT: ${{ secrets.ENDPOINT }} ENDPOINT: ${{ secrets.ENDPOINT }}
steps: steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- run: mkdir ${{ github.sha }} - run: mkdir ${{ github.sha }}
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
path: ${{ github.sha }} path: ${{ github.sha }}
- name: Prepare artifacts - name: Upload artifacts
shell: bash shell: bash
run: | run: |
sudo apt install zip -y sudo apt install zip -y
cd ${{ github.sha }} ARTDIR=$(git describe --tags)
cd $ARTDIR
for build in *; do for build in *; do
cd $build cd $build
zip -r ../$build.zip * zip -r ../$build.zip *
@ -132,9 +139,6 @@ jobs:
rm -r $build rm -r $build
done done
cd .. cd ..
- name: Upload artifacts
shell: bash
run: |
umask 077 umask 077
printf %s "$BOT_SSH_KEY" > cdn_key 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