Compare commits
7 Commits
master
...
more-CICD-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c315de5ad | ||
|
|
cedf2777e6 | ||
|
|
4f72bf38ae | ||
|
|
b7d82da4d9 | ||
|
|
856218f0b9 | ||
|
|
402085fa69 | ||
|
|
257415b512 |
12
.github/workflows/android.yml
vendored
12
.github/workflows/android.yml
vendored
@ -26,6 +26,8 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
|
||||
version=$(<release-version)
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: store dummy version and build number for non-push build runs
|
||||
if: github.event_name != 'push'
|
||||
@ -58,10 +60,10 @@ jobs:
|
||||
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
|
||||
# get the build number via curl so this works both for a pull request as well as a push
|
||||
BUILDNR=$(curl -q https://raw.githubusercontent.com/subsurface/nightly-builds/main/latest-subsurface-buildnumber)
|
||||
OUTPUT_DIR="$GITHUB_WORKSPACE"
|
||||
KEYSTORE_FILE="$KEYSTORE_FILE"
|
||||
KEYSTORE_PASSWORD="pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
|
||||
KEYSTORE_ALIAS="${{ secrets.ANDROID_KEYSTORE_ALIAS }}"
|
||||
export OUTPUT_DIR="$GITHUB_WORKSPACE"
|
||||
export KEYSTORE_FILE="$KEYSTORE_FILE"
|
||||
export KEYSTORE_PASSWORD="pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
|
||||
export KEYSTORE_ALIAS="${{ secrets.ANDROID_KEYSTORE_ALIAS }}"
|
||||
bash -x ./subsurface/packaging/android/qmake-build.sh -buildnr ${BUILDNR}
|
||||
|
||||
# only publish a 'release' on push events (those include merging a PR)
|
||||
@ -69,7 +71,7 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v$(<release-version)
|
||||
tag_name: v${{ steps.version_number.outputs.version }}
|
||||
repository: subsurface/nightly-builds
|
||||
token: ${{ secrets.NIGHTLY_BUILDS }}
|
||||
prerelease: false
|
||||
|
||||
6
.github/workflows/linux-trusty-5.12.yml
vendored
6
.github/workflows/linux-trusty-5.12.yml
vendored
@ -22,6 +22,8 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
|
||||
version=$(<release-version)
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: store dummy version and build number for pull request
|
||||
if: github.event_name == 'pull_request'
|
||||
@ -55,14 +57,14 @@ jobs:
|
||||
- name: prepare release artifacts
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
mv Subsurface.AppImage Subsurface-v(<release-version).AppImage
|
||||
mv Subsurface.AppImage Subsurface-v${{ steps.version_number.outputs.version }}.AppImage
|
||||
|
||||
# only publish a 'release' on push events (those include merging a PR)
|
||||
- name: upload binaries
|
||||
if: github.event_name == 'push'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v$(<release-version)
|
||||
tag_name: v${{ steps.version_number.outputs.version }}
|
||||
repository: subsurface/nightly-builds
|
||||
token: ${{ secrets.NIGHTLY_BUILDS }}
|
||||
prerelease: false
|
||||
|
||||
5
.github/workflows/mac.yml
vendored
5
.github/workflows/mac.yml
vendored
@ -19,6 +19,8 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
|
||||
version=$(<release-version)
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: store dummy version and build number for pull request
|
||||
if: github.event_name == 'pull_request'
|
||||
@ -40,7 +42,6 @@ jobs:
|
||||
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
||||
export PATH=$QT_ROOT/bin:$PATH
|
||||
export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake
|
||||
DIR=$(pwd)
|
||||
|
||||
# now setup Subsurface with WebKit and build the dependencies, using the generic build script
|
||||
bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit -release -build-deps -ftdi -prep-only
|
||||
@ -58,7 +59,7 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v$(<release-version)
|
||||
tag_name: v${{ steps.version_number.outputs.version }}
|
||||
repository: subsurface/nightly-builds
|
||||
token: ${{ secrets.NIGHTLY_BUILDS }}
|
||||
prerelease: false
|
||||
|
||||
9
.github/workflows/post-releasenotes.yml
vendored
9
.github/workflows/post-releasenotes.yml
vendored
@ -3,6 +3,9 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@ -14,17 +17,21 @@ jobs:
|
||||
- name: checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# since we are running this step on a pull request, we will skip build numbers in releases
|
||||
- name: atomically create or retrieve the build number and assemble release notes
|
||||
id: version_number
|
||||
run: |
|
||||
bash -x ./scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
|
||||
bash scripts/create-releasenotes.sh ${{ github.event.head_commit.id }}
|
||||
version=$(<release-version)
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
# ironically, we have to upload a file, otherwise this won't create a release with just the release notes
|
||||
- name: publish release
|
||||
if: github.event_name == 'push'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v$(<release-version)
|
||||
tag_name: v${{ steps.version_number.outputs.version }}
|
||||
repository: subsurface/nightly-builds
|
||||
token: ${{ secrets.NIGHTLY_BUILDS }}
|
||||
prerelease: false
|
||||
|
||||
5
.github/workflows/windows.yml
vendored
5
.github/workflows/windows.yml
vendored
@ -22,6 +22,9 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
bash scripts/get-atomic-buildnr.sh ${{ github.sha }} ${{ secrets.NIGHTLY_BUILDS }} "CICD-release"
|
||||
version=$(<release-version)
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
- name: store dummy version and build number for pull request
|
||||
if: github.event_name == 'pull_request'
|
||||
@ -51,7 +54,7 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v$(<release-version)
|
||||
tag_name: v${{ steps.version_number.outputs.version }}
|
||||
repository: subsurface/nightly-builds
|
||||
token: ${{ secrets.NIGHTLY_BUILDS }}
|
||||
prerelease: false
|
||||
|
||||
@ -19,8 +19,8 @@ git remote set-url origin "$url"
|
||||
git push origin main
|
||||
echo "build number prior to get-or-create was $(<latest-subsurface-buildnumber)"
|
||||
cd ..
|
||||
bash -x subsurface/scripts/get-or-create-build-nr.sh "$1" &> /dev/null
|
||||
echo "build number after get-or-create is $(<subsurface/latest-subsurface-buildnumber)"
|
||||
bash -x subsurface/scripts/get-or-create-build-nr.sh "$1"
|
||||
echo "build number after get-or-create is $(<nightly-builds/latest-subsurface-buildnumber)"
|
||||
cp nightly-builds/latest-subsurface-buildnumber subsurface
|
||||
[[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension
|
||||
bash subsurface/scripts/get-version > subsurface/release-version
|
||||
|
||||
@ -33,13 +33,13 @@ else
|
||||
|
||||
# now comes the moment of truth - are we the first one?
|
||||
# the push will succeed for exactly one of the workflows
|
||||
if git push https://github.com/subsurface/nightly-builds "$SHA_BRANCH"
|
||||
if git push origin "$SHA_BRANCH"
|
||||
then
|
||||
# yay - we win! now let's make sure that we remember this number for next time
|
||||
git checkout main
|
||||
echo $latest > latest-subsurface-buildnumber
|
||||
git commit -a -m "record latest build number in main branch"
|
||||
if ! git push https://github.com/subsurface/nightly-builds main
|
||||
if ! git push origin main
|
||||
then
|
||||
echo "push to main failed - we'll lose monotonic property"
|
||||
exit 1
|
||||
@ -48,7 +48,7 @@ else
|
||||
# someone else was faster - get the number they wrote
|
||||
git checkout main &> /dev/null
|
||||
git branch -D "$SHA_BRANCH" &> /dev/null
|
||||
if ! git checkout -b "$SHA_BRANCH" &> /dev/null
|
||||
if ! git checkout "$SHA_BRANCH" &> /dev/null
|
||||
then
|
||||
echo "push to $SHA_BRANCH failed, but switching to it failed as well"
|
||||
exit 2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user