mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
62d7d92a0e
Bumps the actions group with 9 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `3` | `4` | | [actions/cache](https://github.com/actions/cache) | `3` | `4` | | [actions/github-script](https://github.com/actions/github-script) | `6` | `7` | | [OpenTTD/actions](https://github.com/openttd/actions) | `2` | `5` | | [github/codeql-action](https://github.com/github/codeql-action) | `2` | `3` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `3` | `4` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `3` | `4` | | [tibdex/github-app-token](https://github.com/tibdex/github-app-token) | `1` | `2` | | [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) | `2` | `3` | Updates `actions/checkout` from 3 to 4 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) Updates `actions/cache` from 3 to 4 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) Updates `actions/github-script` from 6 to 7 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v6...v7) Updates `OpenTTD/actions` from 2 to 5 - [Release notes](https://github.com/openttd/actions/releases) - [Commits](https://github.com/openttd/actions/compare/v2...v5) Updates `github/codeql-action` from 2 to 3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) Updates `actions/download-artifact` from 3 to 4 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) Updates `actions/upload-artifact` from 3 to 4 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) Updates `tibdex/github-app-token` from 1 to 2 - [Release notes](https://github.com/tibdex/github-app-token/releases) - [Commits](https://github.com/tibdex/github-app-token/compare/v1...v2) Updates `peter-evans/repository-dispatch` from 2 to 3 - [Release notes](https://github.com/peter-evans/repository-dispatch/releases) - [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: OpenTTD/actions dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: tibdex/github-app-token dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: peter-evans/repository-dispatch dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
193 lines
5.4 KiB
YAML
193 lines
5.4 KiB
YAML
name: Release (Windows Store)
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
windows-store:
|
|
name: Windows Store
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Download source
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: internal-source
|
|
|
|
- name: Unpack source
|
|
shell: bash
|
|
run: |
|
|
tar -xf source.tar.gz --strip-components=1
|
|
|
|
- name: Download x86 build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: openttd-windows-x86
|
|
|
|
- name: Download x64 build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: openttd-windows-x64
|
|
|
|
- name: Download arm64 build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: openttd-windows-arm64
|
|
|
|
- name: Unpack builds
|
|
shell: bash
|
|
run: |
|
|
mkdir builds
|
|
cd builds
|
|
|
|
function extract {
|
|
mkdir $1
|
|
|
|
# Extract the zip version of the release
|
|
unzip ../openttd-*-windows-$2.zip -d $1
|
|
|
|
# Remove the extraneous directory
|
|
mv $1/openttd-*-windows-$2/* $1/
|
|
rmdir $1/openttd-*-windows-$2
|
|
|
|
# Move the openttd.exe to the '{arch}-binaries' folder
|
|
mkdir $1-binaries
|
|
mv $1/openttd.exe $1-binaries/
|
|
}
|
|
|
|
extract x86 win32
|
|
extract x64 win64
|
|
extract arm64 arm64
|
|
|
|
# Use the "x86" folder as the source of the common binaries (lang files, etc) and remove the others
|
|
mv x86 common-binaries
|
|
rm -rf x64 arm64
|
|
|
|
- name: Install OpenGFX
|
|
shell: bash
|
|
run: |
|
|
mkdir -p builds/common-binaries/baseset
|
|
cd builds/common-binaries/baseset
|
|
|
|
echo "::group::Download OpenGFX"
|
|
curl -L https://cdn.openttd.org/opengfx-releases/7.1/opengfx-7.1-all.zip -o opengfx-all.zip
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::Unpack OpenGFX"
|
|
unzip opengfx-all.zip
|
|
tar xf opengfx-*.tar
|
|
echo "::endgroup::"
|
|
|
|
rm -f opengfx-all.zip opengfx-*.tar
|
|
|
|
- name: Install OpenMSX
|
|
shell: bash
|
|
run: |
|
|
mkdir -p builds/common-binaries/baseset
|
|
cd builds/common-binaries/baseset
|
|
|
|
echo "::group::Download OpenMSX"
|
|
curl -L https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip -o openmsx-all.zip
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::Unpack OpenGFX"
|
|
unzip openmsx-all.zip
|
|
tar xf openmsx-*.tar
|
|
echo "::endgroup::"
|
|
|
|
rm -f openmsx-all.zip openmsx-*.tar
|
|
|
|
- name: Install OpenSFX
|
|
shell: bash
|
|
run: |
|
|
mkdir -p builds/common-binaries/baseset/opensfx
|
|
cd builds/common-binaries/baseset/opensfx
|
|
|
|
echo "::group::Download OpenSFX"
|
|
curl -L https://cdn.openttd.org/opensfx-releases/1.0.3/opensfx-1.0.3-all.zip -o opensfx-all.zip
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::Unpack OpenSFX"
|
|
unzip opensfx-all.zip
|
|
tar xf opensfx-*.tar
|
|
echo "::endgroup::"
|
|
|
|
rm -f opensfx-all.zip opensfx-*.tar
|
|
|
|
- name: Generate signing certificate
|
|
shell: cmd
|
|
run: |
|
|
cd builds
|
|
|
|
REM We need to provide a signed .appx to the Windows Store, so generate a certificate with password 'password'
|
|
call ..\os\windows\winstore\generate-key.bat "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" password cert.pfx
|
|
|
|
- name: Generate assets
|
|
shell: cmd
|
|
run: |
|
|
cd os\windows\winstore
|
|
call generate-assets.bat
|
|
|
|
- name: Prepare manifests
|
|
shell: cmd
|
|
run: |
|
|
cd builds
|
|
mkdir manifests
|
|
|
|
REM Set the version environment variable
|
|
call ..\os\windows\winstore\set-version.bat x86-binaries\openttd.exe
|
|
|
|
call ..\os\windows\winstore\prepare-manifests.bat manifests "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" "57420OpenTTDDevelopers.OpenTTDofficial"
|
|
|
|
- name: Prepare binaries
|
|
shell: bash
|
|
run: |
|
|
cd builds
|
|
|
|
# Copy the Windows Store assets
|
|
mkdir common-binaries/Assets
|
|
cp -R ../os/windows/winstore/assets-common/* common-binaries/Assets/
|
|
|
|
mkdir Assets
|
|
cp -R ../os/windows/winstore/assets/* Assets/
|
|
|
|
cp manifests/*.xml .
|
|
|
|
- name: Build
|
|
shell: cmd
|
|
run: |
|
|
REM Add the Windows SDK tools to the PATH
|
|
|
|
echo|set /p="SET VS_INSTALLDIR=" > _vspath.bat
|
|
vswhere -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath >> _vspath.bat
|
|
call _vspath.bat
|
|
call "%VS_INSTALLDIR%\Common7\Tools\VsDevCmd.bat"
|
|
|
|
REM Set the version environment variable
|
|
call os\windows\winstore\set-version.bat builds\x86-binaries\openttd.exe
|
|
|
|
cd builds
|
|
mkdir output
|
|
|
|
REM Build and sign the package
|
|
makeappx build /v /f PackagingLayout.xml /op output\ /bv %OTTD_VERSION% /pv %OTTD_VERSION% /ca
|
|
SignTool sign /fd sha256 /a /f cert.pfx /p password "output\OpenTTD.appxbundle"
|
|
|
|
REM Move resulting files to bundles folder
|
|
mkdir bundles
|
|
mkdir bundles\internal
|
|
move cert.pfx bundles\internal\openttd-${{ inputs.version }}-windows-store.pfx
|
|
move output\OpenTTD.appxbundle bundles\internal\openttd-${{ inputs.version }}-windows-store.appxbundle
|
|
|
|
- name: Store bundles
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: openttd-windows-store
|
|
path: builds/bundles
|
|
retention-days: 5
|