From 9fdfbe7f972c68f0ffad642aa5035771dfaa568b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 17 Dec 2024 14:43:46 +0100 Subject: [PATCH] ci: Add a release workflow. --- .github/workflows/build.yml | 1 + .github/workflows/release.yaml | 33 +++++++++++++++++++++++++++++++++ .releaserc.json | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .releaserc.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5009dbb..4bc9028 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ on: jobs: build: + name: '🏗️ Build' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d21558c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: Release + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + release: + name: '🚀 Semantic Release' + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + - name: Install dependencies + run: npm clean-install + - name: Release + #env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..2ebd479 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,20 @@ +{ + "branches" : [ + "main" + ], + "plugins" : [ + [ + "@semantic-release/commit-analyzer", + { + "preset" : "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset" : "conventionalcommits" + } + ], + "@semantic-release/github" + ] +}