Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: build with CMake and release with semantic-release #118

Merged
merged 6 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .appveyor.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Continuous Integration

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
build:
name: Build
runs-on: windows-2022
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 1
- name: Build
run: |
cmake -E make_directory build/x64
cmake -E make_directory build/Win32
cd build/x64
cmake -A x64 ../../
cmake --build . --config RelWithDebInfo
cd ../../build/Win32
cmake -A Win32 ../../
cmake --build . --config RelWithDebInfo
- name: Copy to dist
run: |
cmake -E make_directory dist
cmake -E copy build/x64/RelWithDebInfo/rcedit.exe dist/rcedit-x64.exe
cmake -E copy build/Win32/RelWithDebInfo/rcedit.exe dist/rcedit-x86.exe
- name: Print help
run: |
dist/rcedit-x86.exe -h
dist/rcedit-x64.exe -h
- name: Upload artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: dist
path: dist/

release:
name: Release
runs-on: windows-2022
needs: build
if: github.ref == 'refs/heads/master'
permissions:
contents: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: dist
path: dist/
- run: npm install -g [email protected] [email protected]
- run: npx [email protected] --dry-run
id: get-next-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Stamp version
if: steps.get-next-version.outputs.new-release-published == 'true'
run: |
set -eo pipefail
dist/rcedit-x64.exe dist/rcedit-x86.exe --set-product-version $VERSION --set-file-version $VERSION
dist/rcedit-x86.exe -h | grep -q Rcedit v$VERSION
dist/rcedit-x86.exe dist/rcedit-x64.exe --set-product-version $VERSION --set-file-version $VERSION
dist/rcedit-x64.exe -h | grep -q Rcedit v$VERSION
env:
VERSION: ${{ steps.get-next-version.outputs.new-release-version }}
- name: Run semantic release
run: npx [email protected] --dry-run
if: steps.get-next-version.outputs.new-release-published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Check Semantic Commit"

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
contents: read

jobs:
main:
permissions:
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: semantic-pull-request
uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Default/
ipch/
build/

*.swp
*.sdf
Expand Down
18 changes: 18 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"plugins": [
"semantic-release-export-data",
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"assets": [
{ "path": "dist/rcedit-x64.exe" },
{ "path": "dist/rcedit-x86.exe" }
],
"draftRelease": true
}
]
],
"branches": [ "master" ]
}
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.15)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")

# /Ox, full optimization
# /Os, favour small code
add_compile_options(/Ox /Os)

project(rcedit)

add_executable(rcedit src/main.cc src/rescle.cc src/rcedit.rc)
target_link_libraries(rcedit version.lib)
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# rcedit [![Build status](https://ci.appveyor.com/api/projects/status/99eokln2emhidcej?svg=true)](https://ci.appveyor.com/project/zcbenz/rcedit/branch/master)
# rcedit

[![Continuous Integration](https://github.com/electron/rcedit/actions/workflows/ci.yml/badge.svg)](https://github.com/electron/rcedit/actions/workflows/ci.yml)

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

## Executables

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

## Building

1. Clone the repository
2. Open `rcedit.sln` with Visual Studio 2015 or above
3. Build

## Generate solution files
To build you need CMake 3.15+ and Visual Studio 2015 or above.

If you have modified the gyp files, you should regenerate the solution files:

1. Make sure you have gyp configured on your system. If not, clone gyp from
https://chromium.googlesource.com/external/gyp
2. Run `gyp rcedit.gyp --depth .`
1. Clone the repository
2. Create a build directory: `cmake -E make_directory build`
3. Change to the build directory: `cd build`
4. Make the CMake project: `cmake ..`
5. Build: `cmake --build .`

## Docs

Expand Down
40 changes: 0 additions & 40 deletions rcedit.gyp

This file was deleted.

19 changes: 0 additions & 19 deletions rcedit.sln

This file was deleted.

82 changes: 0 additions & 82 deletions rcedit.vcxproj

This file was deleted.

Loading