1 Commits
Author SHA1 Message Date
jakub 28b6957ada ci: add Jenkinsfile and shell.nix for builds
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-08-05 15:00:58 +02:00
7 changed files with 29 additions and 20 deletions
-4
View File
@@ -2,8 +2,4 @@
To create certificates you should first fill in the form, specifying lot number, the quantity of cards for which you need to create a certificate, destination path for the certificates file and choose the output encryption PGP key. You also need a Keycard to sign the certificates. Path `m/43'/60'/1581'/2'/0` will be used to sign.
# Continuous Integration
The CI builds can be found in Jenkins under [keycard-certify](https://ci.infra.status.im/job/keycard-certify/).
The [`release`](https://ci.infra.status.im/job/keycard-certify/job/release/)` job builds the app for Linux, MacOS, and Windows, then publishes all artifacts to a GitHub release based on version set in `package.json`.
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
// vim:ft=Jenkinsfile
library 'status-jenkins-lib@v1.7.12'
library 'status-jenkins-lib@v1.7.11'
pipeline {
/* Allows to run the same Jenkinsfile on different platforms. */
@@ -40,13 +40,13 @@ pipeline {
stages {
stage('Deps') {
steps { script {
sh 'npm install'
nix.shell('npm install', pure: true)
} }
}
stage('Build') {
steps { script {
sh 'npm run dist'
nix.shell('npm run dist', pure: false)
} }
}
+1 -5
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
// vim:ft=Jenkinsfile
library 'status-jenkins-lib@v1.7.12'
library 'status-jenkins-lib@github-add-verbose'
pipeline {
/* Allows to run the same Jenkinsfile on different platforms. */
@@ -37,9 +37,6 @@ pipeline {
stage('MacOS') { steps { script {
macos = jenkins.Build('keycard-certify/platforms/macos/x86_64')
} } }
stage('Windows') { steps { script {
windows = jenkins.Build('keycard-certify/platforms/windows/x86_64')
} } }
}
}
@@ -48,7 +45,6 @@ pipeline {
sh('rm -f pkg/*')
jenkins.copyArts(linux)
jenkins.copyArts(macos)
jenkins.copyArts(windows)
version = readJSON(file: 'package.json')['version']
dir('pkg') {
/* generate sha256 checksums for upload */
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "keycard-certify",
"version": "1.1.0",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "keycard-certify",
"version": "1.1.0",
"version": "1.0.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "keycard-certify",
"version": "1.1.0",
"version": "1.0.0",
"description": "Keycard Ident Certificate Creation Application",
"main": "./out/app.js",
"scripts": {
+20
View File
@@ -0,0 +1,20 @@
{
source ? builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/e7603eba51f2c7820c0a182c6bbb351181caa8e7.tar.gz";
sha256 = "sha256:0mwck8jyr74wh1b7g6nac1mxy6a0rkppz8n12andsffybsipz5jw";
},
pkgs ? import source {}
}:
let
inherit (pkgs) lib stdenv darwin;
inherit (darwin.apple_sdk_11_0.frameworks) PCSC;
in pkgs.mkShell {
name = "keycard-certify-shell";
buildInputs = with pkgs; [ nodejs-18_x python310 ];
propagatedBuildInputs = if stdenv.isDarwin then [ PCSC ] else [ pkgs.pcsclite ];
env.NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.isDarwin)
"-I ${lib.getDev pkgs.pcsclite}/include/PCSC";
}
+2 -5
View File
@@ -187,7 +187,6 @@ export class Card {
let caKey = BIP32KeyPair.fromTLV(data);
let encKey = fs.readFileSync(gpgKey, { encoding: 'utf8', flag: 'r' });
let encData = "";
let plainData = "";
this.window.send("pub-key", Buffer.from(CryptoUtils.compressPublicKey(caKey.publicKey)).toString('hex'));
@@ -196,8 +195,8 @@ export class Card {
let certData = certificate.toStoreData();
let cardID = lot + '-' + Utils.uint20ToBase32(i);
let certDataString = dataHeader + Buffer.from(certData).toString('hex');
encData += cardID + "," + certDataString + "\n";
plainData += cardID + "," + Buffer.from(certificate.identPub).toString('hex') + "\n";
let line = cardID + "," + certDataString + "\n";
encData += line;
}
let encryptedData = await openpgp.encrypt({
@@ -205,9 +204,7 @@ export class Card {
encryptionKeys: await openpgp.readKey({ armoredKey: encKey }),
});
let plainPath = path.join(path.dirname(destPath), (path.basename(destPath, ".csv.asc") + ".public.csv"));
fs.writeFileSync(destPath, encryptedData);
fs.writeFileSync(plainPath, plainData);
this.window.send("certificate-creation-success");
}