Skip to content

Commit c6fdfca

Browse files
author
Soumya Mahunt
committed
ci: setup CI/CD pipeline
1 parent 2d3f341 commit c6fdfca

File tree

5 files changed

+418
-0
lines changed

5 files changed

+418
-0
lines changed

.github/config/config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict'
2+
const config = require('conventional-changelog-conventionalcommits');
3+
4+
module.exports = config({
5+
"types": [
6+
{ type: 'feat', section: '🚀 Features' },
7+
{ type: 'fix', section: '🐛 Fixes' },
8+
{ type: 'perf', section: '🐎 Performance Improvements' },
9+
{ type: 'revert', section: '⏪ Reverts' },
10+
{ type: 'build', section: '🛠 Build System' },
11+
{ type: 'ci', section: '💡 Continuous Integration' },
12+
{ type: 'refactor', section: '🔥 Refactorings' },
13+
{ type: 'doc', section: '📚 Documentation' },
14+
{ type: 'docs', section: '📚 Documentation' },
15+
{ type: 'style', section: '💄 Styles' },
16+
{ type: 'test', section: '✅ Tests' },
17+
{ type: 'wip', hidden: true },
18+
{ type: 'chore', hidden: true },
19+
]
20+
})

.github/config/package-lock.json

Lines changed: 223 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/config/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "config",
3+
"version": "1.0.0",
4+
"description": "conventional-changelog-action hooks",
5+
"main": "config.js",
6+
"license": "MIT",
7+
"author": {
8+
"name": "Soumya Ranjan Mahunt",
9+
"email": "devsoumyamahunt@gmail.com"
10+
},
11+
"dependencies": {
12+
"@actions/core": "1.6.0",
13+
"conventional-changelog-conventionalcommits": "^4.6.3",
14+
"semver": "^7.3.5"
15+
}
16+
}

.github/config/pre_changelog_hook.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path');
2+
const fs = require('fs');
3+
const semver = require('semver');
4+
const core = require('@actions/core');
5+
const childProcess = require("child_process");
6+
7+
exports.preVersionGeneration = (version) => {
8+
const { GITHUB_WORKSPACE } = process.env;
9+
core.info(`Computed version bump: ${version}`);
10+
11+
const gem_info_file = path.join(GITHUB_WORKSPACE, 'lib/cocoapods-embed-flutter/gem_version.rb');
12+
const gem_info = `${fs.readFileSync(gem_info_file)}`;
13+
core.info(`Current gem info: ${gem_info}`);
14+
15+
currentVersion = gem_info.match(/VERSION\s*=\s'(.*)'/)[1];
16+
core.info(`Current version: ${currentVersion}`);
17+
18+
if (semver.lt(version, currentVersion)) { version = currentVersion; }
19+
core.info(`Final version: ${version}`);
20+
21+
const new_gem_info = gem_info.replace(/VERSION\s*=\s*.*/g, `VERSION = '${version}'.freeze`);
22+
core.info(`Updated gem info: ${new_gem_info}`);
23+
fs.writeFileSync(gem_info_file, new_gem_info);
24+
25+
const launchOption = { cwd: GITHUB_WORKSPACE };
26+
childProcess.execSync('bundle exec rake demo', launchOption);
27+
return version;
28+
}
29+
30+
exports.preTagGeneration = (tag) => { }

0 commit comments

Comments
 (0)