Add GitHub Actions CI/CD (#23)

* Create linux.yml

* Create windows.yml

* re-enable static builds
make a better linux github workflow

* better windows action script
fix linux output zip

* fix path typos

* Update readme

---------

Co-authored-by: Neo <321592+Neo-Desktop@users.noreply.github.com>
This commit is contained in:
TheTank20 2023-06-16 07:57:56 -05:00 committed by GitHub
parent 62ab8caf87
commit 40c60e656f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 121 additions and 14 deletions

33
.github/workflows/linux.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: C/C++ CI (Linux)
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Setup build environment
run: |
sudo apt -y update
sudo apt -y install build-essential cmake libssl-dev
- name: Build WindowsXPKg
uses: threeal/cmake-action@latest
- name: Move files to correct directory
run: |
mkdir -p build/actions_upload
mv build/xpkey build/keys.json build/actions_upload/
- name: Upload build artifact
uses: actions/upload-artifact@v3.1.2
with:
name: WindowsXPKg-linux-x86_64-static
path: build/actions_upload

36
.github/workflows/windows.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: C/C++ CI (Windows)
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Source Tree
uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Build WindowsXPKg
run: |
cd build
cmake ../
msbuild ALL_BUILD.vcxproj /P:Configuration=Release
- name: Copy files and clean up output directory
run: |
del "build/Release/*.lib"
copy "keys.json" "build/Release/keys.json"
- name: Upload build artifact
uses: actions/upload-artifact@v3.1.2
with:
name: WindowsXPKg-Win64
path: build/Release

View File

@ -2,12 +2,18 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
PROJECT(WindowsXPKg) PROJECT(WindowsXPKg)
SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD 17)
# TODO: commenting out static builds for now SET(BUILD_SHARED_LIBS OFF)
#SET(OPENSSL_USE_STATIC_LIBS TRUE) SET(CMAKE_EXE_LINKER_FLAGS "-static")
SET(OPENSSL_USE_STATIC_LIBS TRUE)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE(OpenSSL REQUIRED)
IF(!OPENSSL_FOUND) IF(!OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "OpenSSL Development Libraries Not Found") MESSAGE(SEND_ERROR "OpenSSL Development Libraries Not Found")
MESSAGE(SEND_ERROR "Please consult your package manager of choice to install the prerequisite")
MESSAGE(SEND_ERROR "The package name is commonly called libssl-dev or openssl-dev depending on distribution")
MESSAGE(FATAL_ERROR "Can not continue without OpenSSL")
ENDIF() ENDIF()
INCLUDE(cmake/CPM.cmake) INCLUDE(cmake/CPM.cmake)
@ -23,8 +29,18 @@ CPMAddPackage("gh:fmtlib/fmt#7.1.3")
CONFIGURE_FILE(keys.json keys.json COPYONLY) CONFIGURE_FILE(keys.json keys.json COPYONLY)
#SET(BUILD_SHARED_LIBS OFF) ADD_LIBRARY(BINK1998 STATIC src/BINK1998.cpp)
#SET(CMAKE_EXE_LINKER_FLAGS "-static") TARGET_INCLUDE_DIRECTORIES(BINK1998 PUBLIC crypto)
ADD_EXECUTABLE(xpkey src/main.cpp src/BINK2002.cpp src/BINK1998.cpp src/key.cpp src/util.cpp src/cli.cpp src/confid.cpp) TARGET_LINK_LIBRARIES(BINK1998 OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
ADD_LIBRARY(BINK2002 STATIC src/BINK2002.cpp)
TARGET_INCLUDE_DIRECTORIES(BINK2002 PUBLIC crypto)
TARGET_LINK_LIBRARIES(BINK2002 OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
ADD_LIBRARY(CONFID STATIC src/confid.cpp)
TARGET_INCLUDE_DIRECTORIES(CONFID PUBLIC crypto)
TARGET_LINK_LIBRARIES(CONFID OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
ADD_EXECUTABLE(xpkey src/main.cpp src/key.cpp src/util.cpp src/cli.cpp)
TARGET_INCLUDE_DIRECTORIES(xpkey PUBLIC crypto) TARGET_INCLUDE_DIRECTORIES(xpkey PUBLIC crypto)
TARGET_LINK_LIBRARIES(xpkey PUBLIC OpenSSL::Crypto nlohmann_json::nlohmann_json fmt) TARGET_LINK_LIBRARIES(xpkey BINK1998 BINK2002 CONFID OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)

View File

@ -29,15 +29,27 @@ In light of the recent exponential interest in this project I've decided to put
### **Usage** ### **Usage**
1. Feel free to use [XPKeygen](https://github.com/Endermanch/XPKeygen) on **Windows** to generate a key, and use such key during installation. #### 1. Download the latest version of WindowsXPKg
* If on **Linux** please clone and compile this repository using `cd build && cmake ../ && make` and run using `./xpkey` to generate a Volume License Key * *(GitHub account required)*
* Download the latest experimental version using the Actions tab ([Windows](https://github.com/Neo-Desktop/WindowsXPKg/actions/workflows/windows.yml), [Linux](https://github.com/Neo-Desktop/WindowsXPKg/actions/workflows/linux.yml)).
2. (For retail only): After installation, you will be prompted to activate Windows. Select the *telephone activation* method, then, run `./xpkey -i <Installation ID>` using the installation ID that the activation wizard gave you.
3. Click "**Next**" * *(GitHub account \*not\* required)*
* Download the latest release for your operating system and architecture from [the releases page](https://github.com/Neo-Desktop/WindowsXPKg/releases)
4. Profit!
* **Note:** Before continuing, please ensure you have both the `xpkey` program and the `keys.json` datum extracted and in the same directory
#### 2. Run `xpkey` to generate a key, or add `--help` to see more options.
#### 3. *(Activation step for `Retail` and `OEM` only)*
* After installation, you will be prompted to activate Windows.
* Select the **telephone activation** method, then, run `xpkey -i <Installation ID>` using the `Installation ID` the activation Wizard provides for you
#### 4. Profit!
------ ------
@ -53,9 +65,19 @@ The list of people who have helped to bring the XP generation to where it is now
* Endermanch * Endermanch
* Neo-Desktop * Neo-Desktop
* WitherOrNot * WitherOrNot
* TheTank20
(the list will be updated to add more collaborators) (the list will be updated to add more collaborators)
**REQUIREMENTS:** ------
* `OpenSSL >0.9.8b` ### **Development Requirements:**
* `CMake, make, gcc` (`build-essential`)
* `OpenSSL 1.1.1+` (`libssl-dev`)
* `git`
#### Build Steps:
1. `git clone`
2. `cd build/ && cmake ../ && make`