Skip to content

Commit

Permalink
Merge pull request #3 from troublecatstudios/add-continuous-integration
Browse files Browse the repository at this point in the history
👷 Add continuous integration
  • Loading branch information
codeimpossible committed Aug 24, 2021
2 parents f508f80 + 2bbeeaa commit 5ba0ed0
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/templates/commit.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[`{{commit.short}}`](https://github.com/{{owner}}/{{repo}}/commit/{{commit.short}}) {{subject}} {{#if issues}}(Issues:{{#each issues}} [`{{text}}`]({{link}}){{/each}}){{/if}}{{#if wip}}{{#each wip}}
- [`{{commit.short}}`](https://github.com/{{owner}}/{{repo}}/commit/{{commit.short}}) {{subject}}{{/each}}
{{/if}}
58 changes: 58 additions & 0 deletions .github/templates/default.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{#if compareUrl}}
# [v{{nextRelease.version}}]({{compareUrl}}) ({{datetime "UTC:yyyy-mm-dd"}})
{{else}}
# v{{nextRelease.version}} ({{datetime "UTC:yyyy-mm-dd"}})
{{/if}}

### Installation url
```
{{#if @root.repository}}
{{~#if @root.host~}}
{{@root.host}}/
{{~/if~}}
{{~#if @root.owner~}}
{{@root.owner}}/
{{~/if~}}
{{@root.repository}}
{{~else~}}
{{@root.repoUrl}}
{{~/if~}}
#{{currentTag}}
```

{{#with commits}}
{{#if sparkles}}
## ✨ New Features
{{#each sparkles}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if bug}}
## 🐛 Bug Fixes
{{#each bug}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if ambulance}}
## 🚑 Critical Hotfixes
{{#each ambulance}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if lock}}
## 🔒 Security Issues
{{#each lock}}
- {{> commitTemplate}}
{{/each}}
{{/if}}

{{#if boom}}
## 💥 Breaking Changes
{{#each boom}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{/with}}
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
workflow_dispatch:
release:
types: [published]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true

- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
semantic-release-gitmoji
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "com.troublecat.chonks",
"version": "0.0.1",
"displayName": "Chonks.net",
"description": "Savegame system for C# (Unity3D, Monogame) projects",
"dependencies": {
"semantic-release-gitmoji": "*"
}
}
44 changes: 44 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const { promisify } = require('util')
const dateFormat = require('dateformat')
const readFileAsync = promisify(require('fs').readFile)
const path = require('path');

const TEMPLATE_DIR = path.resolve(__dirname, './.github/templates');

// the *.hbs template and partials should be passed as strings of contents
const template = readFileAsync(path.join(TEMPLATE_DIR, 'default.hbs'))
const commitTemplate = readFileAsync(path.join(TEMPLATE_DIR, 'commit.hbs'))

module.exports = {
plugins: [
[
'semantic-release-gitmoji', {
releaseRules: {
major: [ ':boom:', '💥' ],
minor: [ ':sparkles:', '✨' ],
patch: [
':bug:', '🐛',
':ambulance:', '🚑',
':lock:', '🔒'
]
},
releaseNotes: {
template,
partials: { commitTemplate },
helpers: {
datetime: function (format = 'UTC:yyyy-mm-dd') {
return dateFormat(new Date(), format)
}
},
issueResolution: {
template: '{baseUrl}/{owner}/{repo}/issues/{ref}',
baseUrl: 'https://github.com',
source: 'github.com'
}
}
}
],
'@semantic-release/git',
'@semantic-release/changelog'
]
}

0 comments on commit 5ba0ed0

Please sign in to comment.