mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-24 20:57:07 +00:00
feat(github): Update changelog workflow and config
This commit is contained in:
3
.actrc
Normal file
3
.actrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
--container-architecture linux/amd64
|
||||||
|
--env-file .env
|
||||||
|
--secret-file .env
|
||||||
11
.github/tag-changelog-config.js
vendored
11
.github/tag-changelog-config.js
vendored
@@ -13,13 +13,14 @@ module.exports = {
|
|||||||
{ types: ['other', 'Other'], label: 'Other Changes' },
|
{ types: ['other', 'Other'], label: 'Other Changes' },
|
||||||
],
|
],
|
||||||
|
|
||||||
excludeTypes: ['other'],
|
excludeTypes: [],
|
||||||
|
|
||||||
renderTypeSection: function (label, commits) {
|
renderTypeSection: function (label, commits) {
|
||||||
let text = `\n## ${ label }\n`
|
let text = `\n## ${ label }\n\n`
|
||||||
|
|
||||||
commits.forEach((commit) => {
|
commits.forEach((commit) => {
|
||||||
text += `- ${ commit.subject }\n`
|
const scope = commit.scope ? `**${ commit.scope }:** ` : ''
|
||||||
|
text += `- ${ scope }${ commit.subject }\n`
|
||||||
})
|
})
|
||||||
|
|
||||||
return text
|
return text
|
||||||
@@ -27,6 +28,8 @@ module.exports = {
|
|||||||
|
|
||||||
renderChangelog: function (release, changes) {
|
renderChangelog: function (release, changes) {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
return `# ${ release } - ${ now.toISOString().substring(0, 10) }\n` + changes + '\n\n'
|
const d = now.toISOString().substring(0, 10);
|
||||||
|
const header = `# ${ release } - ${ d }\n`;
|
||||||
|
return header + changes + '\n\n'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/workflows/changelog.yml
vendored
2
.github/workflows/changelog.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
uses: loopwerk/tag-changelog@v1
|
uses: loopwerk/tag-changelog@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
config_file: .github/tag-changelog-config.js
|
config_file: ./../.github/tag-changelog-config.js
|
||||||
|
|
||||||
- name: "Echo results"
|
- name: "Echo results"
|
||||||
id: output-changelog
|
id: output-changelog
|
||||||
|
|||||||
35
.github/workflows/new-release.yml
vendored
35
.github/workflows/new-release.yml
vendored
@@ -18,34 +18,23 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3 # Checkout our working repository
|
- uses: actions/checkout@v3 # Checkout our working repository
|
||||||
|
|
||||||
- uses: fregante/daily-version-action@v2
|
- name: Create tag if necessary
|
||||||
name: Create tag if necessary
|
uses: fregante/daily-version-action@v2
|
||||||
id: daily-version
|
id: daily-version
|
||||||
|
|
||||||
- name: Conventional Changelog Action
|
- name: Create changelog text
|
||||||
if: steps.daily-version.outputs.created
|
if: steps.daily-version.outputs.created
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: TriPSs/conventional-changelog-action@v3
|
uses: loopwerk/tag-changelog@v1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
skip-git-pull: "true"
|
config_file: ./../.github/tag-changelog-config.js
|
||||||
output-file: "false"
|
|
||||||
fallback-version: "${{ steps.daily-version.outputs.version }}"
|
|
||||||
skip-version-file: "true"
|
|
||||||
git-message: "chore(release): {version}"
|
|
||||||
git-user-name: "${{ github.actor }}"
|
|
||||||
git-user-email: "${{ github.actor }}@users.noreply.github.com"
|
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
if: env.DAILY_VERSION_CREATED
|
uses: actions/create-release@latest
|
||||||
uses: actions/github-script@v6.4.1
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
tag_name: ${{ steps.daily-version.outputs.version }}
|
||||||
script: |
|
release_name: Release ${{ steps.daily-version.outputs.version }}
|
||||||
await github.request(
|
body: ${{ steps.changelog.outputs.changes }}
|
||||||
`POST /repos/${{ github.repository }}/releases`,
|
|
||||||
{
|
|
||||||
tag_name: "${{ steps.daily-version.outputs.version }}",
|
|
||||||
body: "${{ steps.daily-version.outputs.clean_changelog }}"
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user