Release #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release Version' | |
required: true | |
jobs: | |
release: | |
environment: deploy | |
runs-on: windows-latest | |
env: | |
UID_VERSION: v4.0.4 | |
ICE_ADAPTER_VERSION: v3.3.7 | |
BUILD_VERSION: ${{ github.event.inputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: pip | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
- name: Download ICE adapter and UID calculator | |
run: | | |
mkdir build_setup\ice-adapter | |
Invoke-WebRequest -Uri "https://github.com/FAForever/uid/releases/download/$($env:UID_VERSION)/faf-uid.exe" -OutFile ".\\build_setup\\faf-uid.exe" | |
Invoke-WebRequest -Uri "https://github.com/FAForever/java-ice-adapter/releases/download/v1.0.0/faf-ice-adapter-jre-base.7z" -OutFile ".\\faf-ice-adapter-jre-base.7z" | |
7z x faf-ice-adapter-jre-base.7z -obuild_setup | |
Remove-Item .\build_setup\ice-adapter\jre -Force -Recurse | |
Invoke-WebRequest -Uri "https://content.faforever.com/build/jre/windows-amd64-21.0.1.tar.gz" -OutFile ".\\windows-amd64-15.0.1.tar.gz" | |
7z x windows-amd64-15.0.1.tar.gz | |
7z x windows-amd64-15.0.1.tar -obuild_setup/ice-adapter/jre | |
Invoke-WebRequest -Uri "https://github.com/FAForever/java-ice-adapter/releases/download/$($env:ICE_ADAPTER_VERSION)/faf-ice-adapter-$($env:ICE_ADAPTER_VERSION)-nojfx.jar" -OutFile ".\\build_setup\\ice-adapter\\faf-ice-adapter.jar" | |
- name: Test with pytest | |
run: | | |
python runtests.py -vv --full-trace | |
- name: Build application | |
run: | | |
python setup.py bdist_msi | |
- name: Get Artifact Paths | |
id: artifact_paths | |
run: | | |
function getMsiPath { | |
$files = Get-ChildItem *.msi -Recurse | Select -First 1 | |
(Get-Item $files).FullName | |
} | |
$WINDOWS_MSI = getMsiPath | |
Write-Host $WINDOWS_MSI | |
$WINDOWS_MSI_NAME = (Get-Item $WINDOWS_MSI).Name | |
Write-Host $WINDOWS_MSI_NAME | |
echo "WINDOWS_MSI=$WINDOWS_MSI" >> "$GITHUB_ENV" | |
echo "WINDOWS_MSI_NAME=$WINDOWS_MSI_NAME" >> "$GITHUB_ENV" | |
- name: Calculate checksum | |
id: checksum | |
run: | | |
Write-Host MSI path is: $WINDOWS_MSI | |
$MSI_SUM = $(CertUtil -hashfile $WINDOWS_MSI SHA256)[1] -replace " ","" | |
Write-Host $MSI_SUM | |
echo "MSI_SUM=$MSI_SUM" >> "GITHUB_ENV" | |
- name: Create draft release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.version }} | |
release_name: ${{ github.event.inputs.version }} | |
body: "SHA256: ${{ steps.checksum.outputs.MSI_SUM }}" | |
draft: true | |
prerelease: true | |
- name: Check release paths | |
run: | | |
echo "MSI path:" | |
Write-Host $WINDOWS_MSI | |
echo "MSI filename:" | |
Write-Host $WINDOWS_MSI_NAME | |
- name: Upload Windows msi | |
id: upload-msi | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: $WINDOWS_MSI | |
asset_name: $WINDOWS_MSI_NAME | |
asset_content_type: application/vnd.microsoft.portable-executable |