2019-10-16 18:31:29 +00:00
|
|
|
name: Windows
|
2019-10-26 01:04:01 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2019-10-16 18:31:29 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-12-11 17:49:40 +00:00
|
|
|
buildWindows:
|
2019-10-16 18:31:29 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2023-12-06 21:20:20 +00:00
|
|
|
image: docker://subsurface/mxe-build-container:3.0.1
|
2019-10-16 18:31:29 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout sources
|
2019-10-17 23:12:42 +00:00
|
|
|
uses: actions/checkout@v1
|
2019-10-16 18:31:29 +00:00
|
|
|
|
2023-12-05 07:35:49 +00:00
|
|
|
- name: create release name
|
|
|
|
id: tag
|
|
|
|
run: |
|
|
|
|
export tag=""
|
|
|
|
export is_latest=false
|
2023-12-07 10:38:00 +00:00
|
|
|
if [ "${{ github.ref_type }}" = "tag" ]
|
|
|
|
then
|
|
|
|
tag="${{ github.ref_name }}"
|
|
|
|
else
|
|
|
|
tag="latest"
|
|
|
|
is_latest=true
|
|
|
|
fi
|
2023-12-05 07:35:49 +00:00
|
|
|
echo "tag=${tag}" >> $GITHUB_OUTPUT
|
|
|
|
echo "is_latest=${is_latest}" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
- name: tag current version as latest if we don't have a tag
|
2023-12-07 10:38:00 +00:00
|
|
|
if: ${{ steps.tag.outputs.is_latest == 'true' }}
|
2023-12-05 07:35:49 +00:00
|
|
|
uses: rickstaa/action-create-tag@v1
|
|
|
|
with:
|
|
|
|
tag: "latest"
|
|
|
|
tag_exists_error: false
|
|
|
|
force_push_tag: true
|
|
|
|
message: "latest commit to allow 'release' uploads"
|
|
|
|
|
2019-10-16 18:31:29 +00:00
|
|
|
- name: get other dependencies
|
2022-05-13 18:33:05 +00:00
|
|
|
env:
|
|
|
|
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
|
2019-10-16 18:31:29 +00:00
|
|
|
run: |
|
2020-05-30 11:21:22 +00:00
|
|
|
echo "Running script to install additional dependancies into container"
|
2022-05-13 18:33:05 +00:00
|
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
|
|
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
|
2020-06-11 07:52:30 +00:00
|
|
|
cd /win
|
|
|
|
ln -s /__w/subsurface/subsurface .
|
2020-05-30 11:21:22 +00:00
|
|
|
bash -x subsurface/.github/workflows/scripts/windows-container-prep.sh 2>&1 | tee pre-build.log
|
2023-12-05 07:35:49 +00:00
|
|
|
|
2019-10-16 18:31:29 +00:00
|
|
|
- name: run build
|
|
|
|
run: |
|
|
|
|
cd /win
|
2019-10-18 16:25:14 +00:00
|
|
|
bash -x subsurface/.github/workflows/scripts/windows-in-container-build.sh 2>&1 | tee build.log
|
2019-10-16 18:31:29 +00:00
|
|
|
grep "Built target installer" build.log
|
|
|
|
|
2023-12-07 18:10:23 +00:00
|
|
|
# only publish a 'release' on push events (those include merging a PR)
|
2023-12-05 07:35:49 +00:00
|
|
|
- name: upload binaries
|
2023-12-07 18:10:23 +00:00
|
|
|
if: github.event_name == 'push'
|
2023-12-05 07:35:49 +00:00
|
|
|
uses: softprops/action-gh-release@v1
|
2019-10-27 02:28:30 +00:00
|
|
|
with:
|
2023-12-05 07:35:49 +00:00
|
|
|
tag_name: ${{ steps.tag.outputs.tag }}
|
|
|
|
prerelease: ${{ steps.tag.outputs.is_latest }}
|
|
|
|
body: CICD release artifact
|
|
|
|
fail_on_unmatched_files: false
|
|
|
|
files: |
|
2023-12-07 12:14:22 +00:00
|
|
|
./subsurface*.exe*
|
|
|
|
./smtk2ssrf*.exe
|