diff --git a/assets/caution.png b/dist/assets/caution.png similarity index 100% rename from assets/caution.png rename to dist/assets/caution.png diff --git a/assets/dateManufacturer.png b/dist/assets/dateManufacturer.png similarity index 100% rename from assets/dateManufacturer.png rename to dist/assets/dateManufacturer.png diff --git a/assets/eifu.png b/dist/assets/eifu.png similarity index 100% rename from assets/eifu.png rename to dist/assets/eifu.png diff --git a/assets/logo.png b/dist/assets/logo.png similarity index 100% rename from assets/logo.png rename to dist/assets/logo.png diff --git a/assets/lot.png b/dist/assets/lot.png similarity index 100% rename from assets/lot.png rename to dist/assets/lot.png diff --git a/assets/manufacturer.png b/dist/assets/manufacturer.png similarity index 100% rename from assets/manufacturer.png rename to dist/assets/manufacturer.png diff --git a/assets/ref.png b/dist/assets/ref.png similarity index 100% rename from assets/ref.png rename to dist/assets/ref.png diff --git a/assets/udi.png b/dist/assets/udi.png similarity index 100% rename from assets/udi.png rename to dist/assets/udi.png diff --git a/assets/ukca.png b/dist/assets/ukca.png similarity index 100% rename from assets/ukca.png rename to dist/assets/ukca.png diff --git a/dist/index.js b/dist/index.js index ab4f98e..b2a8be0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -116180,14 +116180,14 @@ async function generatePdf() { shortVersion: await getVersion('short'), releaseDate: await getCurrentDate(), previousFiles: mapped, - manufacturer: readFileSync('../assets/manufacturer.png').toString('base64'), - dateManufacturer: readFileSync('../assets/dateManufacturer.png').toString('base64'), - ref: readFileSync('../assets/ref.png').toString('base64'), - lot: readFileSync('../assets/lot.png').toString('base64'), - udi: readFileSync('../assets/udi.png').toString('base64'), - ukca: readFileSync('../assets/ukca.png').toString('base64'), - caution: readFileSync('../assets/caution.png').toString('base64'), - eifu: readFileSync('../assets/eifu.png').toString('base64') + manufacturer: readFileSync('assets/manufacturer.png').toString('base64'), + dateManufacturer: readFileSync('assets/dateManufacturer.png').toString('base64'), + ref: readFileSync('assets/ref.png').toString('base64'), + lot: readFileSync('assets/lot.png').toString('base64'), + udi: readFileSync('assets/udi.png').toString('base64'), + ukca: readFileSync('assets/ukca.png').toString('base64'), + caution: readFileSync('assets/caution.png').toString('base64'), + eifu: readFileSync('assets/eifu.png').toString('base64') }); /** @@ -116197,7 +116197,7 @@ async function generatePdf() { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.setContent(html, {waitUntil: ['load', 'domcontentloaded', 'networkidle0']}) - await page.addStyleTag({path: '../styles/pdf.css'}); + await page.addStyleTag({path: './styles/pdf.css'}); const pdf = await page.pdf({ format: 'A4', printBackground: true, diff --git a/styles/pdf.css b/dist/styles/pdf.css similarity index 100% rename from styles/pdf.css rename to dist/styles/pdf.css diff --git a/package.json b/package.json index 557862e..c61bb71 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "publish-pdf-version-action", "main": "src/index.js", "scripts": { - "build": "ncc build src/" + "build": "ncc build src/index.js && npx cpx \"src/**/*.{png,css}\" dist" }, "repository": { "type": "git", diff --git a/src/assets/caution.png b/src/assets/caution.png new file mode 100644 index 0000000..68bbfbe Binary files /dev/null and b/src/assets/caution.png differ diff --git a/src/assets/dateManufacturer.png b/src/assets/dateManufacturer.png new file mode 100644 index 0000000..4b7267a Binary files /dev/null and b/src/assets/dateManufacturer.png differ diff --git a/src/assets/eifu.png b/src/assets/eifu.png new file mode 100644 index 0000000..64cbedb Binary files /dev/null and b/src/assets/eifu.png differ diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 0000000..c146780 Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/assets/lot.png b/src/assets/lot.png new file mode 100644 index 0000000..4f11c77 Binary files /dev/null and b/src/assets/lot.png differ diff --git a/src/assets/manufacturer.png b/src/assets/manufacturer.png new file mode 100644 index 0000000..fd64ad9 Binary files /dev/null and b/src/assets/manufacturer.png differ diff --git a/src/assets/ref.png b/src/assets/ref.png new file mode 100644 index 0000000..0f35def Binary files /dev/null and b/src/assets/ref.png differ diff --git a/src/assets/udi.png b/src/assets/udi.png new file mode 100644 index 0000000..8e3a911 Binary files /dev/null and b/src/assets/udi.png differ diff --git a/src/assets/ukca.png b/src/assets/ukca.png new file mode 100644 index 0000000..dba371a Binary files /dev/null and b/src/assets/ukca.png differ diff --git a/src/index.js b/src/index.js index d0c7a61..bff21ad 100644 --- a/src/index.js +++ b/src/index.js @@ -158,14 +158,14 @@ async function generatePdf() { shortVersion: await getVersion('short'), releaseDate: await getCurrentDate(), previousFiles: mapped, - manufacturer: readFileSync('../assets/manufacturer.png').toString('base64'), - dateManufacturer: readFileSync('../assets/dateManufacturer.png').toString('base64'), - ref: readFileSync('../assets/ref.png').toString('base64'), - lot: readFileSync('../assets/lot.png').toString('base64'), - udi: readFileSync('../assets/udi.png').toString('base64'), - ukca: readFileSync('../assets/ukca.png').toString('base64'), - caution: readFileSync('../assets/caution.png').toString('base64'), - eifu: readFileSync('../assets/eifu.png').toString('base64') + manufacturer: readFileSync('assets/manufacturer.png').toString('base64'), + dateManufacturer: readFileSync('assets/dateManufacturer.png').toString('base64'), + ref: readFileSync('assets/ref.png').toString('base64'), + lot: readFileSync('assets/lot.png').toString('base64'), + udi: readFileSync('assets/udi.png').toString('base64'), + ukca: readFileSync('assets/ukca.png').toString('base64'), + caution: readFileSync('assets/caution.png').toString('base64'), + eifu: readFileSync('assets/eifu.png').toString('base64') }); /** @@ -175,7 +175,7 @@ async function generatePdf() { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.setContent(html, {waitUntil: ['load', 'domcontentloaded', 'networkidle0']}) - await page.addStyleTag({path: '../styles/pdf.css'}); + await page.addStyleTag({path: './styles/pdf.css'}); const pdf = await page.pdf({ format: 'A4', printBackground: true, diff --git a/src/styles/pdf.css b/src/styles/pdf.css new file mode 100644 index 0000000..8b3e1f6 --- /dev/null +++ b/src/styles/pdf.css @@ -0,0 +1,54 @@ +body { + font-family: "Helvetica Neue", sans-serif; + padding: 20px; +} + +h1 { + font-weight: 400; +} + +table { + font-family: "Helvetica Neue", sans-serif; + border-collapse: collapse; +} + +td, th { + border: 2px solid black; + text-align: left; +} + +th { + background: #FF7B99; + color: white; + font-weight: normal; + padding: 10px; +} + +h1 { + margin-top: 0; +} + +td { + padding: 8px; +} + +.paragraph { + margin: 30px 0 20px; +} + +.box { + padding: 10px 0 0 0; +} + +.label-container { + display: flex; + flex-direction: row; + align-items: center; + margin: 20px 20px 0 0; +} + +img { + width: 50px; + height: 50px; + margin: 0 20px 0 0; +}