Skip to content

Builder main installer #23

Builder main installer

Builder main installer #23

Workflow file for this run

name: Builder main installer
on:
workflow_dispatch:
release:
types: [created]
env:
SRC_PATH: ${{ github.workspace }}/src
INSTALLER_SCRIPT_PATH: ${{ github.workspace }}/src/bin/installer/bin
FULL_INSTALLER_PATH: ${{ github.workspace }}/src/bin/installer/iss/full
LITE_INSTALLER_PATH: ${{ github.workspace }}/src/bin/installer/iss/lite
jobs:
build-job:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ env.SRC_PATH }}
- name: Install Python packages
run: pip install py7zr pefile colorama
- name: Unpack tools
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
run: python unpack-project.py -f ${{ env.SRC_PATH }}/toolkit
- name: Build documents
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
run: ./build-docs.bat
- name: Update full installer .iss config paths
working-directory: ${{ env.FULL_INSTALLER_PATH }}
shell: bash
run: |
WORKSPACE_BUILD_PATH=$(echo "${{ github.workspace }}" | tr '\\' '/')
WORKSPACE_SRC_PATH=$(echo "${{ env.SRC_PATH }}" | tr '\\' '/')
sed -i "s|C:\\\\code\\\\toolkit|$WORKSPACE_SRC_PATH|g" setup.iss
sed -i "s|C:\\\\code|$WORKSPACE_BUILD_PATH|g" setup.iss
- name: Update version number in full installer .iss
working-directory: ${{ env.FULL_INSTALLER_PATH }}
shell: bash
run: |
VERSION_CODE=$(date +'%Y.%m')
sed -i 's/RELEASE/'"$VERSION_CODE"'/g' setup.iss
- name: Build full installer
working-directory: ${{ env.FULL_INSTALLER_PATH }}
run: ISCC.exe setup.iss
- name: Update lite installer .iss config paths
working-directory: ${{ env.LITE_INSTALLER_PATH }}
shell: bash
run: |
WORKSPACE_BUILD_PATH=$(echo "${{ github.workspace }}" | tr '\\' '/')
WORKSPACE_SRC_PATH=$(echo "${{ env.SRC_PATH }}" | tr '\\' '/')
sed -i "s|C:\\\\code\\\\toolkit|$WORKSPACE_SRC_PATH|g" setup.iss
sed -i "s|C:\\\\code|$WORKSPACE_BUILD_PATH|g" setup.iss
- name: Update version number in lite installer .iss
working-directory: ${{ env.LITE_INSTALLER_PATH }}
shell: bash
run: |
VERSION_CODE=$(date +'%Y.%m')
sed -i 's/RELEASE/'"$VERSION_CODE"'/g' setup.iss
- name: Build lite installer
working-directory: ${{ env.LITE_INSTALLER_PATH }}
run: ISCC.exe setup.iss
- name: Generate checksums report
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
.\generate-checksums.ps1 -Directory "${{ env.SRC_PATH }}/toolkit" -OutputFile "${{ github.workspace }}/tools_checksums.txt"
.\generate-checksums.ps1 -Directory "${{ github.workspace }}" -FilePattern "*.exe" -NoRecurse -OutputFile "${{ github.workspace }}/installer_checksums.txt"
- name: Upload Setup as Artifact
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: setup-installer-artifact
path: |
${{ github.workspace }}/*.exe
${{ github.workspace }}/tools_checksums.txt
${{ github.workspace }}/installer_checksums.txt
- name: Upload Setup as Artifact to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
${{ github.workspace }}/*.exe
${{ github.workspace }}/tools_checksums.txt
${{ github.workspace }}/installer_checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}