|
| 1 | +const { promisify } = require("util"); |
| 2 | +const dateFormat = require("dateformat"); |
| 3 | +const { join } = require("node:path"); |
| 4 | +const readFileAsync = promisify(require("fs").readFile); |
| 5 | + |
| 6 | +const TEMPLATE_DIR = |
| 7 | + "node_modules/semantic-release-gitmoji/lib/assets/templates"; |
| 8 | +// the *.hbs template and partials should be passed as strings of contents |
| 9 | +const template = readFileAsync(join(TEMPLATE_DIR, "default-template.hbs")); |
| 10 | +const commitTemplate = readFileAsync(join(TEMPLATE_DIR, "commit-template.hbs")); |
| 11 | + |
| 12 | +module.exports = { |
| 13 | + branches: [ |
| 14 | + "main", |
| 15 | + "+([0-9])?(.{+([0-9]),x}).x", |
| 16 | + "next", |
| 17 | + "next-major", |
| 18 | + { |
| 19 | + name: "alpha", |
| 20 | + prerelease: true, |
| 21 | + }, |
| 22 | + { |
| 23 | + name: "beta", |
| 24 | + prerelease: true, |
| 25 | + }, |
| 26 | + ], |
| 27 | + plugins: [ |
| 28 | + [ |
| 29 | + "semantic-release-gitmoji", |
| 30 | + { |
| 31 | + releaseRules: { |
| 32 | + major: [":boom:"], |
| 33 | + minor: [":sparkles:"], |
| 34 | + patch: [":bug:", ":ambulance:", ":lock:", ":lipstick"], |
| 35 | + }, |
| 36 | + releaseNotes: { |
| 37 | + template, |
| 38 | + partials: { commitTemplate }, |
| 39 | + helpers: { |
| 40 | + datetime: function (format = "UTC:yyyy-mm-dd") { |
| 41 | + return dateFormat(new Date(), format); |
| 42 | + }, |
| 43 | + }, |
| 44 | + issueResolution: { |
| 45 | + template: "{baseUrl}/{owner}/{repo}/issues/{ref}", |
| 46 | + baseUrl: "https://github.com", |
| 47 | + source: "github.com", |
| 48 | + removeFromCommit: false, |
| 49 | + regex: /#\d+/g, |
| 50 | + }, |
| 51 | + }, |
| 52 | + }, |
| 53 | + ], |
| 54 | + "@semantic-release/npm", |
| 55 | + [ |
| 56 | + "@semantic-release/github", |
| 57 | + { |
| 58 | + assets: [ |
| 59 | + { |
| 60 | + path: "dist/muc-patternlab-vue.es.js", |
| 61 | + label: "JS distribution", |
| 62 | + }, |
| 63 | + { |
| 64 | + path: "dist/assets/temporary/muenchende-style.css", |
| 65 | + label: "CSS distribution", |
| 66 | + }, |
| 67 | + { |
| 68 | + path: "dist/assets/temporary/muenchende-fontfaces.css", |
| 69 | + label: "CSS fontface distribution", |
| 70 | + }, |
| 71 | + { |
| 72 | + path: "dist/assets/temporary/muc-icons.svg", |
| 73 | + label: "SVG sprite distribution", |
| 74 | + }, |
| 75 | + ], |
| 76 | + }, |
| 77 | + ], |
| 78 | + ], |
| 79 | +}; |
0 commit comments