-
Notifications
You must be signed in to change notification settings - Fork 227
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
Added minimal CI + Signing section #503
Open
iTrooz
wants to merge
11
commits into
maharmstone:master
Choose a base branch
from
iTrooz:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
321ca2b
added .gitignore
iTrooz b5e2683
added notice about Ninja generator
iTrooz 3f945bb
Added 'Signing' section
iTrooz fa90118
Added CI
iTrooz 1146f62
added instructions for disabling signature enforcement
iTrooz 4d20847
Added CI build status in the README
iTrooz e179119
Refactored arch names
iTrooz ba03aab
TEST : Sign driver in CI
iTrooz 6aa2376
Linting corrections from Saibamen
iTrooz d534ee9
use github native badge
iTrooz d96a877
Merge branch 'master' into master
iTrooz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Build CI | ||
|
||
on: | ||
push: | ||
branches: ["*"] | ||
pull_request: | ||
branches: ["*"] | ||
workflow_dispatch: | ||
|
||
env: | ||
BUILD_CONFIG: RelWithDebInfo | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- shell_arch: x64 | ||
win_arch: x64 | ||
- shell_arch: x86 | ||
win_arch: x86 | ||
- shell_arch: amd64_arm64 | ||
win_arch: arm64 | ||
- shell_arch: amd64_arm | ||
win_arch: arm | ||
|
||
name: Build for ${{ matrix.win_arch }} | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Get Sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup shell | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.shell_arch }} | ||
|
||
- name: Prepare build | ||
run: cmake -B build -G "Ninja" | ||
|
||
- name: Build | ||
run: cmake --build build --config ${{env.BUILD_CONFIG}} -j 3 | ||
|
||
- name: Prepare files for upload | ||
run: | | ||
mkdir upload | ||
mkdir upload/${{ matrix.win_arch }} | ||
|
||
copy src/btrfs.inf upload | ||
copy build/ubtrfs.dll upload/${{ matrix.win_arch }} | ||
copy build/shellbtrfs.dll upload/${{ matrix.win_arch }} | ||
copy build/mkbtrfs.exe upload/${{ matrix.win_arch }} | ||
copy build/btrfs.sys upload/${{ matrix.win_arch }} | ||
|
||
mkdir upload-pdb | ||
mkdir upload-pdb/${{ matrix.win_arch }} | ||
|
||
copy build/ubtrfs.pdb upload-pdb/${{ matrix.win_arch }} | ||
copy build/shellbtrfs.pdb upload-pdb/${{ matrix.win_arch }} | ||
copy build/mkbtrfs.pdb upload-pdb/${{ matrix.win_arch }} | ||
copy build/btrfs.pdb upload-pdb/${{ matrix.win_arch }} | ||
|
||
- name: Upload driver files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: btrfs | ||
path: upload/* | ||
|
||
- name: Upload PDB files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: btrfs-pdb | ||
path: upload-pdb/* | ||
|
||
sign: | ||
needs: build | ||
runs-on: windows-latest | ||
name: Sign | ||
|
||
env: | ||
INF2CAT_PROGRAM: 'C:/Program Files (x86)/Windows Kits/10/bin/x86/Inf2Cat.exe' | ||
|
||
steps: | ||
- name: Get Sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup shell | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x86 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: btrfs | ||
path: upload | ||
|
||
- name: Import key | ||
run: | | ||
# Create the PFX file from the base64-encoded secret | ||
"${{ secrets.PFX_FILE_B64 }}" | Out-File -FilePath pfx.b64 | ||
CertUtil -decode pfx.b64 cert.pfx | ||
# Import it | ||
$plaintextpwd = "password" | ||
$pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText | ||
Import-PfxCertificate -FilePath ./cert.pfx -CertStoreLocation Cert:\CurrentUser\My -Password $pwd | ||
|
||
- name: Create catalog file | ||
run: | | ||
cd upload | ||
& "${{env.INF2CAT_PROGRAM}}" /os:10_NI_X64 /driver:. | ||
|
||
- name: Sign catalog file | ||
run: | | ||
cd upload | ||
SignTool sign /fd SHA256 /v /s My /n "Btrfs driver" /t http://timestamp.digicert.com btrfs.cat | ||
|
||
- name: Upload driver | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: btrfs | ||
path: upload/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
out | ||
.vs | ||
build | ||
build-* |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be PowerShell (
mkdir
is not PowerShell), and should copybtrfs-vol.inf
as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your interest in this is because you are planning to run your own fork with different filename limits, do NOT do this. You will corrupt your filesystem when you use it on Linux, as even with the changes on that Russian site the kernel driver will overwrite other data with the long filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah that's not my sole reason, I did try that. It didn't corrupt anything, but I did get a warning on Linux when running
btrfs
commands, renaming such paths removes any warnings, and just works.My goal wasn't really to run a fork (branch is deleted now), but just to see if the CI worked, it didn't work well enough for me, so I learned how to do the signing manually.