Skip to content

Commit

Permalink
feat: use semantic-release to create automated releases (#5)
Browse files Browse the repository at this point in the history
* feat: use semantic-release to create automated releases

* fix: use "main" branch
  • Loading branch information
TimPietrusky authored Apr 18, 2024
1 parent a026d5d commit dfed3dd
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- "main"

jobs:
release:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Setup 7zip
uses: milliewalky/setup-7-zip@v1

- name: Install dependencies
run: npm install

- name: Fix auto-fixable eslint issues
run: npm run eslint -- --fix

- name: Update the ToC in the README.md
run: npx markdown-toc README.md -i

- name: Semantic release
uses: codfish/semantic-release-action@v3
with:
additional-packages: |
['@semantic-release/git', '@semantic-release/changelog', '@semantic-release/exec']
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "npm run build && 7z a app.7z ./out/*"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "app.7z"
}
]
}
]
]
}

0 comments on commit dfed3dd

Please sign in to comment.