build-system: replace repetitive GH Action code with script call

This is now much easier to maintain.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-01-08 15:57:38 -08:00
parent 4527abe936
commit f1ac55d322
7 changed files with 7 additions and 91 deletions

View file

@ -25,19 +25,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd $BUILD_ROOT # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for non-push build runs

View file

@ -29,19 +29,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: Setup API token for copr-cli

View file

@ -24,19 +24,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request

View file

@ -21,19 +21,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request

View file

@ -18,19 +18,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request

View file

@ -18,19 +18,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: Setup build dependencies

View file

@ -21,19 +21,7 @@ jobs:
id: version_number
if: github.event_name == 'push'
run: |
cd .. # check out parallel to subsurface sources
url="https://subsurface:${{ secrets.NIGHTLY_BUILDS }}@github.com/subsurface/nightly-builds"
# the clone followed by the pointless push should verify that the password is stored in the config
# that way the script doesn't need the password
git clone -b main https://github.com/subsurface/nightly-builds
cd nightly-builds
git remote set-url origin "$url"
git push origin main
cd ..
bash -x subsurface/scripts/get-or-create-build-nr.sh ${{ github.sha }}
cp nightly-builds/latest-subsurface-buildnumber subsurface
echo "CICD-release" > subsurface/latest-subsurface-buildnumber-extension
version=$(bash subsurface/scripts/get-version)
version=$(bash subsurface/scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release")
echo "version=$version" >> $GITHUB_OUTPUT
- name: store dummy version and build number for pull request