ci(ci-semver): add semver release for binaries

This commit is contained in:
ZanzyTHEbar 2023-01-08 20:41:31 +00:00
parent 05589705dd
commit 1e2960f793
2 changed files with 95 additions and 13 deletions

View File

@ -2,7 +2,6 @@ name: Build and Release the OpenIris bin files
on:
push:
branches:
- "mdns-autodiscovery"
- "master"
pull_request:
branches:
@ -51,11 +50,11 @@ jobs:
working-directory: ./ESP
run: |
pio run --environment ${{ matrix.target_name }}${{ matrix.target_build_type }}
- name: Archive Version File
uses: actions/upload-artifact@v3
with:
name: version
path: ./ESP/tools/version.txt
#- name: Archive Version File
# uses: actions/upload-artifact@v3
# with:
# name: version
# path: ./ESP/tools/version.txt
- name: Archive Firmware name File
# create an environment variable with the name of the firmware file by catting the firmware_name.txt file
run: |
@ -74,11 +73,27 @@ jobs:
uses: actions/download-artifact@v2
with:
path: release
- name: Release Firmware
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
- name: Checkout
uses: actions/checkout@v2
with:
artifacts: release/*/*.bin
generateReleaseNotes: true
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g conventional-changelog-angular
- run: npm install -g semantic-release@v19.0.5
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release
#uses: ncipollo/release-action@v1
#if: startsWith(github.ref, 'refs/tags/')
#with:
# artifacts: release/*/*.bin
# generateReleaseNotes: true
# allowUpdates: true
# token: ${{ secrets.GITHUB_TOKEN }}

67
.releaserc Normal file
View File

@ -0,0 +1,67 @@
{
"branches": [
"main",
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "docs",
"release": "patch"
},
{
"type": "refactor",
"scope": "core-*",
"release": "minor"
},
{
"type": "feat",
"scope": "feat-*",
"release": "minor"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "ci",
"scope": "ci-*",
"release": "patch"
},
{
"scope": "no-release",
"release": false
}
],
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES"
]
}
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "sed -i 's/\"version\": \"[0-9\\.]*\",/\"version\": \"${nextRelease.version}\",/g' ./ESP/lib/library.json"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"ESP/lib/library.json",
"ESP/.pio/build/**/*.bin"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}