- To future proof APatch Alternate patching, give an option to the us… #285
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
# | |
# Copyright (C) 2024 Badabing2005 | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
# | |
# This program is free software: you can redistribute it and/or modify it under | |
# the terms of the GNU Affero General Public License as published by the Free | |
# Software Foundation, either version 3 of the License, or (at your option) any | |
# later version. | |
# | |
# This program is distributed in the hope that it will be useful, but WITHOUT | |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License | |
# for more details. | |
# | |
# You should have received a copy of the GNU Affero General Public License | |
# along with this program. If not, see <https://www.gnu.org/licenses/>. | |
# | |
# Also add information on how to contact you by electronic and paper mail. | |
# | |
# If your software can interact with users remotely through a computer network, | |
# you should also make sure that it provides a way for users to get its source. | |
# For example, if your program is a web application, its interface could | |
# display a "Source" link that leads users to an archive of the code. There are | |
# many ways you could offer source, and different solutions will be better for | |
# different programs; see section 13 for the specific requirements. | |
# | |
# You should also get your employer (if you work as a programmer) or school, if | |
# any, to sign a "copyright disclaimer" for the program, if necessary. For more | |
# information on this, and how to apply and follow the GNU AGPL, see | |
# <https://www.gnu.org/licenses/>. | |
name: Build for All platforms | |
env: | |
ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Controls when the workflow will run | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Build tags' | |
jobs: | |
# --------------------------------------------------------------------------- | |
# build_windows | |
# --------------------------------------------------------------------------- | |
build_windows: | |
if: github.actor == 'badabing2005' | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Create virtual environment | |
run: python -m venv myenv | |
shell: powershell | |
- name: Activate virtual environment | |
run: .\myenv\Scripts\Activate.ps1 | |
shell: powershell | |
- name: Install wxPython and build | |
run: | | |
python --version | |
pip install -U six wheel setuptools | |
pip install -U -f https://extras.wxpython.org/wxPython4/extras/4.2.1 wxPython | |
shell: powershell | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: List modules and their versions | |
run: pip freeze | |
- name: Build application | |
run: .\build.bat | |
- name: List contents of dist directory | |
run: ls dist | |
- name: Sign Windows Executable | |
uses: skymatic/code-sign-action@v1 | |
with: | |
certificate: '${{ secrets.CERTIFICATE }}' | |
password: '${{ secrets.CERT_PASSWORD }}' | |
certificatesha1: '${{ secrets.CERTHASH }}' | |
certificatename: '${{ secrets.CERTNAME }}' | |
description: 'PixelFlasher' | |
timestampUrl: 'http://timestamp.digicert.com' | |
folder: 'dist' | |
recursive: false | |
- name: Get sha256 | |
run: | | |
certutil -hashfile dist/PixelFlasher.exe SHA256 > dist/PixelFlasher.exe.sha256 | |
cat dist/PixelFlasher.exe.sha256 | |
- name: List contents of dist directory again | |
run: ls dist | |
# Upload artifacts Windows | |
- name: Upload Windows Artifact | |
uses: actions/upload-artifact@v4 | |
id: upload_artifacts_windows | |
with: | |
name: PixelFlasher.exe Artifacts | |
path: | | |
dist/PixelFlasher.exe | |
dist/PixelFlasher.exe.sha256 | |
# --------------------------------------------------------------------------- | |
# build_windows_2019 | |
# --------------------------------------------------------------------------- | |
build_windows_2019: | |
if: github.actor == 'badabing2005' | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Create virtual environment | |
run: python -m venv myenv | |
shell: powershell | |
- name: Activate virtual environment | |
run: .\myenv\Scripts\Activate.ps1 | |
shell: powershell | |
- name: Install wxPython and build | |
run: | | |
python --version | |
pip install -U six wheel setuptools | |
pip install -U -f https://extras.wxpython.org/wxPython4/extras/4.2.1 wxPython | |
shell: powershell | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: List modules and their versions | |
run: pip freeze | |
- name: Build application | |
run: .\build.bat | |
- name: Rename the file | |
run: mv dist/PixelFlasher.exe dist/PixelFlasher_Win_2019.exe | |
- name: List contents of dist directory | |
run: ls dist | |
- name: Sign Windows Executable | |
uses: skymatic/code-sign-action@v1 | |
with: | |
certificate: '${{ secrets.CERTIFICATE }}' | |
password: '${{ secrets.CERT_PASSWORD }}' | |
certificatesha1: '${{ secrets.CERTHASH }}' | |
certificatename: '${{ secrets.CERTNAME }}' | |
description: 'PixelFlasher' | |
timestampUrl: 'http://timestamp.digicert.com' | |
folder: 'dist' | |
recursive: false | |
- name: Get sha256 | |
run: | | |
certutil -hashfile dist/PixelFlasher_Win_2019.exe SHA256 > dist/PixelFlasher_Win_2019.exe.sha256 | |
cat dist/PixelFlasher_Win_2019.exe.sha256 | |
- name: List contents of dist directory again | |
run: ls dist | |
# Upload artifacts Windows 2019 | |
- name: Upload Windows 2019 Artifact | |
uses: actions/upload-artifact@v4 | |
id: upload_artifacts_windows_2019 | |
with: | |
name: PixelFlasher_Win_2019.exe Artifacts | |
path: | | |
dist/PixelFlasher_Win_2019.exe | |
dist/PixelFlasher_Win_2019.exe.sha256 | |
# --------------------------------------------------------------------------- | |
# build_ubuntu_20_04 | |
# --------------------------------------------------------------------------- | |
build_ubuntu_20_04: | |
if: github.actor == 'badabing2005' | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
run: | | |
sudo apt update | |
sudo apt install software-properties-common -y | |
sudo add-apt-repository ppa:deadsnakes/ppa -y | |
sudo apt update | |
sudo apt install -y python3.11 | |
sudo apt install -y python3.11-venv | |
sudo apt install -y python3-pip | |
python3.11 --version | |
- name: Install wxPython prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3.11-dev | |
sudo apt-get install -y libgtk-3-dev | |
sudo apt-get install -y libunwind-dev | |
sudo apt-get install -y libgstreamer1.0-dev | |
sudo apt-get install -y gstreamer1.0-plugins-base | |
sudo apt-get install -y freeglut3-dev | |
sudo apt-get install -y libwebkit2gtk-4.0-dev | |
sudo apt-get install -y libjpeg-dev | |
sudo apt-get install -y libpng-dev | |
sudo apt-get install -y libtiff-dev | |
sudo apt-get install -y libsdl2-dev | |
sudo apt-get install -y libnotify-dev | |
sudo apt-get install -y libsm-dev | |
- name: Create virtual environment, install dependencies, and build | |
run: | | |
python3.11 -m venv myenv | |
. myenv/bin/activate | |
python --version | |
pip install -U pip | |
pip install -U six wheel setuptools | |
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython | |
pip install -r requirements.txt | |
python --version && pip freeze | |
./build.sh | |
mv dist/PixelFlasher dist/PixelFlasher_Ubuntu_20_04 | |
sha256sum dist/PixelFlasher_Ubuntu_20_04 > dist/PixelFlasher_Ubuntu_20_04.sha256 | |
cat dist/PixelFlasher_Ubuntu_20_04.sha256 | |
ls dist | |
shell: bash | |
# Upload artifacts Ubuntu 20.04 | |
- name: Upload Ubuntu 20.04 Artifact | |
uses: actions/upload-artifact@v4 | |
id: upload_artifacts_ubuntu_20_04 | |
with: | |
name: PixelFlasher_Ubuntu_20_04 Artifacts | |
path: | | |
dist/PixelFlasher_Ubuntu_20_04 | |
dist/PixelFlasher_Ubuntu_20_04.sha256 | |
# --------------------------------------------------------------------------- | |
# build_ubuntu_22_04 | |
# --------------------------------------------------------------------------- | |
build_ubuntu_22_04: | |
if: github.actor == 'badabing2005' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
run: | | |
sudo apt update | |
sudo apt install software-properties-common -y | |
sudo add-apt-repository ppa:deadsnakes/ppa -y | |
sudo apt update | |
sudo apt install -y python3.11 | |
sudo apt install -y python3.11-venv | |
sudo apt install -y python3-pip | |
python3.11 --version | |
- name: Install wxPython prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3.11-dev | |
sudo apt-get install -y libgtk-3-dev | |
sudo apt-get install -y libunwind-dev | |
sudo apt-get install -y libgstreamer1.0-dev | |
sudo apt-get install -y gstreamer1.0-plugins-base | |
sudo apt-get install -y freeglut3-dev | |
sudo apt-get install -y libwebkit2gtk-4.0-dev | |
sudo apt-get install -y libjpeg-dev | |
sudo apt-get install -y libpng-dev | |
sudo apt-get install -y libtiff-dev | |
sudo apt-get install -y libsdl2-dev | |
sudo apt-get install -y libnotify-dev | |
sudo apt-get install -y libsm-dev | |
- name: Create virtual environment, install dependencies, and build | |
run: | | |
python3.11 -m venv myenv | |
. myenv/bin/activate | |
python --version | |
pip install -U pip | |
pip install -U six wheel setuptools | |
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython | |
pip install -r requirements.txt | |
python --version && pip freeze | |
./build.sh | |
mv dist/PixelFlasher dist/PixelFlasher_Ubuntu_22_04 | |
sha256sum dist/PixelFlasher_Ubuntu_22_04 > dist/PixelFlasher_Ubuntu_22_04.sha256 | |
cat dist/PixelFlasher_Ubuntu_22_04.sha256 | |
ls dist | |
shell: bash | |
# Upload artifacts Ubuntu 22.04 | |
- name: Upload Ubuntu 22.04 Artifact | |
uses: actions/upload-artifact@v4 | |
id: upload_artifacts_ubuntu_22_04 | |
with: | |
name: PixelFlasher_Ubuntu_22_04 Artifacts | |
path: | | |
dist/PixelFlasher_Ubuntu_22_04 | |
dist/PixelFlasher_Ubuntu_22_04.sha256 | |
# --------------------------------------------------------------------------- | |
# build_mac_12 | |
# --------------------------------------------------------------------------- | |
build_mac_12: | |
if: github.actor == 'badabing2005' | |
# runs-on: macos-latest | |
runs-on: macos-12 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: List Cellar directory | |
run: | | |
ls /usr/local/Cellar | |
- name: Uninstall Pythons other than 3.11 | |
run: | | |
brew uninstall --ignore-dependencies python@3.12 || true | |
echo "doing brew list" | |
brew list | |
echo "getting directory list for /usr/local/Cellar" | |
ls /usr/local/Cellar | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install wxPython | |
# run: brew install wxpython | |
run: pip install wxPython | |
# - name: Install node | |
# run: brew install node | |
- name: Install create-dmg | |
run: | | |
npm cache clean --force | |
npm install --global create-dmg | |
- name: Add Python 3.11 to PATH | |
run: export PATH=/usr/local/Cellar/python@3.11/bin:$PATH | |
- name: Create virtual environment | |
run: python3.11 -m venv myenv | |
shell: bash | |
- name: Activate virtual environment | |
run: source myenv/bin/activate | |
shell: bash | |
- name: Install requirements | |
run: python3.11 -m pip install -r requirements.txt | |
- name: List modules and their versions | |
run: python3.11 -m pip freeze | |
- name: Build application | |
id: build_app | |
run: ./build.sh | |
- name: Upload PixelFlasher.app as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PixelFlasher.app | |
path: dist/PixelFlasher.app | |
# - name: Create DMG | |
# id: create_dmg | |
# run: | | |
# create-dmg dist/PixelFlasher.app dist | |
# ls -l ./ dist/ | |
# if: ${{ steps.build_app.outcome == 'success' }} | |
# continue-on-error: true | |
# - name: Rename the file | |
# id: rename_dmg | |
# run: mv dist/PixelFlasher*.dmg dist/PixelFlasher.dmg | |
- name: Get sha256 | |
run: | | |
shasum -a 256 dist/PixelFlasher.dmg > dist/PixelFlasher.dmg.sha256 | |
cat dist/PixelFlasher.dmg.sha256 | |
if: ${{ steps.build_app.outcome == 'success' }} | |
- name: List contents of dist directory | |
run: ls ./ dist/ | |
# Upload artifacts Mac-OS 12 | |
- name: Upload Mac-OS 12 Artifact | |
uses: actions/upload-artifact@v4 | |
id: upload_artifact_macos_12 | |
with: | |
name: PixelFlasher.dmg Artifacts | |
path: | | |
dist/PixelFlasher.dmg | |
dist/PixelFlasher.dmg.sha256 | |
# --------------------------------------------------------------------------- | |
# deploy | |
# --------------------------------------------------------------------------- | |
deploy: | |
if: github.actor == 'badabing2005' | |
needs: [build_windows, build_windows_2019, build_ubuntu_20_04, build_ubuntu_22_04, build_mac_12] | |
runs-on: ubuntu-latest | |
steps: | |
# Get version | |
- name: Get version from tag | |
id: get_version | |
run: | | |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
version=${GITHUB_REF#refs/tags/v} | |
else | |
version=0.0.0.${GITHUB_REF#refs/heads/} | |
fi | |
echo "version=${version}" >> "${GITHUB_OUTPUT}" | |
# Download the Windows artifact from the build_windows job | |
- name: Download Windows Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: PixelFlasher.exe Artifacts | |
path: release | |
continue-on-error: true | |
# Download the Windows-2019 artifact from the build_windows_2019 job | |
- name: Download Windows-2019 Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: PixelFlasher_Win_2019.exe Artifacts | |
path: release | |
continue-on-error: true | |
# Download the Ubuntu_20_04 artifact from the build_ubuntu_20_04 job | |
- name: Download Ubuntu_20_04 Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: PixelFlasher_Ubuntu_20_04 Artifacts | |
path: release | |
continue-on-error: true | |
# Download the Ubuntu_22_04 artifact from the build_ubuntu_22_04 job | |
- name: Download Ubuntu_22_04 Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: PixelFlasher_Ubuntu_22_04 Artifacts | |
path: release | |
continue-on-error: true | |
# Download the Mac-OS artifacts from the build_mac_12 job | |
- name: Download Mac-OS Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: PixelFlasher.dmg Artifacts | |
path: release | |
continue-on-error: true | |
# List the artifacts downloaded | |
- name: List contents of dist directory | |
run: ls ${{ github.workspace }}/release* | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: v${{ steps.get_version.outputs.version }} | |
name: Release v${{ steps.get_version.outputs.version }} | |
# body_path: RELEASE.md | |
draft: true | |
prerelease: false | |
files: | | |
release/* | |
continue-on-error: true |