mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Change the builds on push (i.e. pull request merges) to build release versions. This seems to be the correct way to build these, as they are now distributed as the official builds on https://subsurface-divelog.org/. For users wanting to help with debugging, build artifacts on pull requests are available, and these are debug builds. Also adding the option to manually trigger builds, so if needed debug builds can be run on `master`. Signed-off-by: Michael Keller <github@ike.ch>
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
name: Windows
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- scripts/docker/**
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths-ignore:
|
|
- scripts/docker/**
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker://subsurface/mxe-build:3.3.0
|
|
|
|
steps:
|
|
- name: checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: set the version information
|
|
id: version_number
|
|
uses: ./.github/actions/manage-version
|
|
with:
|
|
nightly-builds-secret: ${{ secrets.NIGHTLY_BUILDS }}
|
|
|
|
- name: get other dependencies
|
|
env:
|
|
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
|
|
run: |
|
|
echo "Running script to install additional dependancies into container"
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
|
|
cd /win
|
|
ln -s /__w/subsurface/subsurface .
|
|
bash -x subsurface/packaging/windows/container-prep.sh 2>&1 | tee pre-build.log
|
|
|
|
- name: run build
|
|
env:
|
|
CANONICALVERSION: ${{ steps.version_number.outputs.version }}
|
|
CANONICALVERSION_4: ${{ steps.version_number.outputs.version_4 }}
|
|
run: |
|
|
BUILD_EXTRA_ARGS=""
|
|
if [ "${GITHUB_EVENT_NAME}" = "push" ]; then
|
|
echo "Building a release version"
|
|
BUILD_EXTRA_ARGS="${BUILD_EXTRA_ARGS} -release"
|
|
fi
|
|
|
|
export OUTPUT_DIR="$GITHUB_WORKSPACE"
|
|
cd /win
|
|
bash -x subsurface/packaging/windows/in-container-build.sh ${BUILD_EXTRA_ARGS} 2>&1 | tee build.log
|
|
grep "Built target installer" build.log
|
|
|
|
- name: publish pull request artifacts
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Subsurface-Windows-${{ steps.version_number.outputs.version }}
|
|
path: |
|
|
subsurface*.exe*
|
|
smtk2ssrf*.exe
|
|
|
|
# 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@v2
|
|
with:
|
|
tag_name: v${{ steps.version_number.outputs.version }}
|
|
repository: ${{ github.repository_owner }}/nightly-builds
|
|
token: ${{ secrets.NIGHTLY_BUILDS }}
|
|
prerelease: false
|
|
fail_on_unmatched_files: true
|
|
files: |
|
|
./subsurface*.exe*
|
|
./smtk2ssrf*.exe
|