Updating buildid

This commit is contained in:
XargonWan 2023-05-03 11:12:00 +02:00
parent 65cf9ea947
commit 26adc54c18
2 changed files with 12 additions and 6 deletions

View file

@ -30,12 +30,18 @@ jobs:
run: sudo umount -f /home/ubuntu/actions-runner/_work/RetroDECK/RetroDECK/.flatpak-builder/rofiles/* run: sudo umount -f /home/ubuntu/actions-runner/_work/RetroDECK/RetroDECK/.flatpak-builder/rofiles/*
continue-on-error: true continue-on-error: true
- name: Generate build ID
id: generating_buildid
run: echo "##[set-output name=build-id;]$(echo "$( git rev-parse --short HEAD )")"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Generate build ID
run: |
word1=$(curl -s https://random-word-api.herokuapp.com/word?length=5 | tr -d '[]"')
capitalized_word1="$(tr '[:lower:]' '[:upper:]' <<< ${word1:0:1})${word1:1}"
word2=$(curl -s https://random-word-api.herokuapp.com/word?length=5 | tr -d '[]"')
capitalized_word2="$(tr '[:lower:]' '[:upper:]' <<< ${word2:0:1})${word2:1}"
result=$capitalized_word1$capitalized_word2
echo $result >> ${GITHUB_WORKSPACE}/buildid
echo "buildid=$result" >> $GITHUB_ENV
- name: Initialize environment - name: Initialize environment
run: | run: |
git pull git pull
@ -78,7 +84,7 @@ jobs:
- name: Publish the flatpak in a new cooker release - name: Publish the flatpak in a new cooker release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: "${{ env.GITHUB_REF_SLUG }}-${{ steps.generating_buildid.outputs.build-id }}" tag: "${{ env.GITHUB_REF_SLUG }}[${{ env.buildid }}]"
body: | body: |
# Release Notes (Cooker) # Release Notes (Cooker)
This is a cooker snapshot based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}. This is a cooker snapshot based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}.

View file

@ -78,7 +78,7 @@ modules:
mkdir -p ${FLATPAK_DEST}/retrodeck/ mkdir -p ${FLATPAK_DEST}/retrodeck/
if [[ $VERSION == *"cooker"* ]]; if [[ $VERSION == *"cooker"* ]];
then then
VERSION="$VERSION-[$(git rev-parse --short HEAD)]" VERSION="$VERSION[$echo ./buildid]"
fi fi
echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version echo $VERSION >> ${FLATPAK_DEST}/retrodeck/version
cat ${FLATPAK_DEST}/retrodeck/version cat ${FLATPAK_DEST}/retrodeck/version