Github: Re-add changes to upstream release workflows

pull/556/head
Jonathan G Rennison 1 year ago
parent 4f7cb1e498
commit 77b3c5726b

@ -0,0 +1,126 @@
name: Release (Linux Distros)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
jobs:
linux-distro:
name: Linux (Distros)
strategy:
fail-fast: false
matrix:
include:
- container_image: "ubuntu:18.04"
bundle_name: "bionic"
compiler: "g++-8"
c_compiler: "gcc-8"
- container_image: "ubuntu:20.04"
bundle_name: "focal"
compiler: "g++"
c_compiler: "gcc"
- container_image: "ubuntu:22.04"
bundle_name: "jammy"
compiler: "g++"
c_compiler: "gcc"
- container_image: "debian:buster"
bundle_name: "buster"
compiler: "g++"
c_compiler: "gcc"
- container_image: "debian:bullseye"
bundle_name: "bullseye"
compiler: "g++"
c_compiler: "gcc"
runs-on: ubuntu-20.04
container:
image: ${{ matrix.container_image }}
steps:
- name: Download source
uses: actions/download-artifact@v3
with:
name: internal-source
- name: Unpack source
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install dependencies
run: |
echo "::group::Update apt"
apt-get update
echo "::endgroup::"
echo "::group::Install dependencies"
apt-get install -y --no-install-recommends \
cmake \
debhelper \
${{ matrix.compiler }} \
${{ matrix.c_compiler }} \
git \
make \
openssl \
libcurl4-openssl-dev \
libfontconfig-dev \
libfluidsynth-dev \
libicu-dev \
liblzma-dev \
libzstd-dev \
liblzo2-dev \
libsdl2-dev \
lsb-release \
zlib1g-dev \
libharfbuzz-dev \
# EOF
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir -p build
cd build
echo "::group::CMake"
CXX=${{ matrix.compiler }} CC=${{ matrix.c_compiler }} cmake ${GITHUB_WORKSPACE} \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_COMPRESS_DEBUG=ON \
-DOPTION_LTO=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
# Ubuntu 18.04 cmake does not support -j so we pass the option to the native tool
cmake --build . -- -j $(nproc)
echo "::endgroup::"
- name: Create bundles
run: |
cd ${GITHUB_WORKSPACE}/build
echo "::group::Run CPack"
cpack
echo "::endgroup::"
echo "::group::Cleanup"
# Remove the sha256 files CPack generates; we will do this ourself at
# the end of this workflow.
rm -f bundles/*.sha256
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v3
with:
name: openttd-linux-${{ matrix.bundle_name }}
path: build/bundles
retention-days: 5

@ -87,6 +87,7 @@ jobs:
nlohmann-json \
sdl2 \
zlib \
zstd \
# EOF
)
echo "::endgroup::"
@ -123,7 +124,9 @@ jobs:
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_COMPRESS_DEBUG=ON \
-DOPTION_LTO=ON \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DOPTION_PACKAGE_DEPENDENCIES=ON \
# EOF

@ -65,6 +65,8 @@ jobs:
nlohmann-json:arm64-osx \
zlib:x64-osx \
zlib:arm64-osx \
zstd:x64-osx \
zstd:arm64-osx \
# EOF
- name: Install GCC problem matcher
@ -88,6 +90,7 @@ jobs:
echo "::endgroup::"
- name: Import code signing certificates
if: ${{ false }} # disable for now
uses: Apple-Actions/import-codesign-certs@v2
with:
# The certificates in a PKCS12 file encoded as a base64 string
@ -108,7 +111,7 @@ jobs:
-DVCPKG_TARGET_TRIPLET=arm64-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
# EOF
echo "::endgroup::"
@ -129,7 +132,7 @@ jobs:
-DVCPKG_TARGET_TRIPLET=x64-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DCPACK_BUNDLE_APPLE_CERT_APP=${{ secrets.APPLE_DEVELOPER_CERTIFICATE_ID }} \
"-DCPACK_BUNDLE_APPLE_CODESIGN_PARAMETER=--deep -f --options runtime" \

@ -95,9 +95,9 @@ jobs:
cmake -DGENERATE_OTTDREV=1 -P cmake/scripts/FindVersion.cmake
./.github/changelog.sh > .changelog
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
cat .ottdrev | cut -f 1 -d$'\t' > .version
head -1 .ottdrev-vc | cut -f 1 -d$'\t' > .version
if [ $(cat .ottdrev | cut -f 5 -d$'\t') = '1' ]; then
if [ $(head -1 .ottdrev-vc | cut -f 5 -d$'\t') = '1' ]; then
# Assume that all tags are always releases. Why else make a tag?
IS_TAG="true"
@ -133,7 +133,7 @@ jobs:
echo "::endgroup::"
echo "Release Date: $(cat .release_date)"
echo "Revision: $(cat .ottdrev)"
echo "Revision: $(cat .ottdrev-vc)"
echo "Version: $(cat .version)"
echo "Is tag: ${IS_TAG}"
echo "Folder on CDN: ${FOLDER}"

@ -104,6 +104,7 @@ jobs:
arch: ${{ matrix.host }}
- name: Import code signing certificate
if: ${{ false }} # Disabled
shell: powershell
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
@ -190,7 +191,7 @@ jobs:
echo "::endgroup::"
- name: Sign installer
if: inputs.is_tag == 'true'
if: ${{ false }} # inputs.is_tag == 'true'
shell: bash
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true

@ -6,13 +6,13 @@ on:
ref:
description: 'Ref to build (for Pull Requests, use refs/pull/NNN/head)'
required: true
repository_dispatch:
# client_payload should be the same as the inputs for workflow_dispatch.
types:
- Build*
release:
types:
- published
# repository_dispatch:
# # client_payload should be the same as the inputs for workflow_dispatch.
# types:
# - Build*
# release:
# types:
# - published
jobs:
source:
@ -41,6 +41,16 @@ jobs:
with:
survey_key: ${{ needs.source.outputs.survey_key }}
linux_distros:
name: Linux (Distros)
needs: source
uses: ./.github/workflows/release-linux-distros.yml
secrets: inherit
with:
survey_key: ${{ needs.source.outputs.survey_key }}
macos:
name: MacOS
needs: source

Loading…
Cancel
Save