Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 6289207

Browse files
authored
fix: Enable Semantic Release (#121)
* Create semantic-release.yml * Create .releaserc.json
1 parent 74262a4 commit 6289207

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Semantic Release
3+
4+
run-name: Semantic Release from ${{ github.ref_name }}
5+
6+
on:
7+
push:
8+
branches:
9+
- '**'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
semantic:
17+
name: Determine version
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
outputs:
21+
new_release_published: ${{ steps.release.outputs.new_release_published }}
22+
new_release_version: ${{ steps.release.outputs.new_release_version }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
- name: Semantic release
29+
id: release
30+
uses: cycjimmy/semantic-release-action@v4
31+
with:
32+
dry_run: true
33+
release:
34+
name: Release version
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 30
37+
needs: semantic
38+
if: ${{ needs.semantic.outputs.new_release_published == 'true' }}
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 1
44+
- name: Release version ${{ steps.release.outputs.new_release_version }} on ${{ github.ref_name }}
45+
run: gh workflow run version.yml --raw-field version=$VERSION --ref $BRANCH
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
48+
VERSION: ${{ needs.semantic.outputs.new_release_version }}
49+
BRANCH: ${{ github.ref_name }}

.releaserc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": [
3+
"+([0-9])?(.{+([0-9]),x}).x",
4+
"main",
5+
"next",
6+
"next-major",
7+
{ "name": "beta", "prerelease": true },
8+
{ "name": "alpha", "prerelease": true }
9+
],
10+
"plugins": ["@semantic-release/commit-analyzer"]
11+
}

0 commit comments

Comments
 (0)