Skip to content

Commit b1f8a3b

Browse files
authored
feat!: build with CMake and release with semantic-release (#118)
BREAKING CHANGE: Drops Windows XP support * refactor: code review suggestion * ci: move print help to build job * refactor: code review suggestion * build: fix * docs: clarify where releases are
1 parent 824746d commit b1f8a3b

14 files changed

+200
-264
lines changed

.appveyor.yml

-42
This file was deleted.

.github/workflows/ci.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
name: Build
17+
runs-on: windows-2022
18+
steps:
19+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
with:
21+
fetch-depth: 1
22+
- name: Build
23+
run: |
24+
cmake -E make_directory build/x64
25+
cmake -E make_directory build/Win32
26+
cd build/x64
27+
cmake -A x64 ../../
28+
cmake --build . --config RelWithDebInfo
29+
cd ../../build/Win32
30+
cmake -A Win32 ../../
31+
cmake --build . --config RelWithDebInfo
32+
- name: Copy to dist
33+
run: |
34+
cmake -E make_directory dist
35+
cmake -E copy build/x64/RelWithDebInfo/rcedit.exe dist/rcedit-x64.exe
36+
cmake -E copy build/Win32/RelWithDebInfo/rcedit.exe dist/rcedit-x86.exe
37+
- name: Print help
38+
run: |
39+
dist/rcedit-x86.exe -h
40+
dist/rcedit-x64.exe -h
41+
- name: Upload artifacts
42+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
43+
with:
44+
name: dist
45+
path: dist/
46+
47+
release:
48+
name: Release
49+
runs-on: windows-2022
50+
needs: build
51+
if: github.ref == 'refs/heads/master'
52+
permissions:
53+
contents: write
54+
steps:
55+
- name: Checkout
56+
id: checkout
57+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
58+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
59+
with:
60+
name: dist
61+
path: dist/
62+
- run: npm install -g [email protected] [email protected]
63+
- run: npx [email protected] --dry-run
64+
id: get-next-version
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
- name: Stamp version
68+
if: steps.get-next-version.outputs.new-release-published == 'true'
69+
run: |
70+
set -eo pipefail
71+
dist/rcedit-x64.exe dist/rcedit-x86.exe --set-product-version $VERSION --set-file-version $VERSION
72+
dist/rcedit-x86.exe -h | grep -q Rcedit v$VERSION
73+
dist/rcedit-x86.exe dist/rcedit-x64.exe --set-product-version $VERSION --set-file-version $VERSION
74+
dist/rcedit-x64.exe -h | grep -q Rcedit v$VERSION
75+
env:
76+
VERSION: ${{ steps.get-next-version.outputs.new-release-version }}
77+
- name: Run semantic release
78+
run: npx [email protected] --dry-run
79+
if: steps.get-next-version.outputs.new-release-published == 'true'
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/semantic.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Check Semantic Commit"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
main:
15+
permissions:
16+
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
17+
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
18+
name: Validate PR Title
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: semantic-pull-request
22+
uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5.4.0
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
validateSingleCommit: false

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Default/
22
ipch/
3+
build/
34

45
*.swp
56
*.sdf

.releaserc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"plugins": [
3+
"semantic-release-export-data",
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/github",
8+
{
9+
"assets": [
10+
{ "path": "dist/rcedit-x64.exe" },
11+
{ "path": "dist/rcedit-x86.exe" }
12+
],
13+
"draftRelease": true
14+
}
15+
]
16+
],
17+
"branches": [ "master" ]
18+
}

CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
3+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
4+
5+
# /Ox, full optimization
6+
# /Os, favour small code
7+
add_compile_options(/Ox /Os)
8+
9+
project(rcedit)
10+
11+
add_executable(rcedit src/main.cc src/rescle.cc src/rcedit.rc)
12+
target_link_libraries(rcedit version.lib)

README.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
# rcedit [![Build status](https://ci.appveyor.com/api/projects/status/99eokln2emhidcej?svg=true)](https://ci.appveyor.com/project/zcbenz/rcedit/branch/master)
1+
# rcedit
2+
3+
[![Continuous Integration](https://github.com/electron/rcedit/actions/workflows/ci.yml/badge.svg)](https://github.com/electron/rcedit/actions/workflows/ci.yml)
24

35
Command line tool to edit resources of exe file on Windows.
46

57
## Executables
68

7-
Prebuilt binaries can be found in the artifacts of appveyor jobs.
9+
Prebuilt binaries can be found in the [GitHub releases](https://github.com/electron/rcedit/releases).
810

911
## Building
1012

11-
1. Clone the repository
12-
2. Open `rcedit.sln` with Visual Studio 2015 or above
13-
3. Build
14-
15-
## Generate solution files
13+
To build you need CMake 3.15+ and Visual Studio 2015 or above.
1614

17-
If you have modified the gyp files, you should regenerate the solution files:
18-
19-
1. Make sure you have gyp configured on your system. If not, clone gyp from
20-
https://chromium.googlesource.com/external/gyp
21-
2. Run `gyp rcedit.gyp --depth .`
15+
1. Clone the repository
16+
2. Create a build directory: `cmake -E make_directory build`
17+
3. Change to the build directory: `cd build`
18+
4. Make the CMake project: `cmake ..`
19+
5. Build: `cmake --build .`
2220

2321
## Docs
2422

rcedit.gyp

-40
This file was deleted.

rcedit.sln

-19
This file was deleted.

rcedit.vcxproj

-82
This file was deleted.

0 commit comments

Comments
 (0)