forked from aws-samples/amplify-next-template
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.46 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release Workflow
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install Dependencies
run: npm install
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/changelog
@semantic-release/npm
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename next.md and update version
run: |
VERSION=$(node -p "require('./package.json').version")
mv docs/releases/next.md docs/releases/v${VERSION}.md
sed -i "s/:VERSION/$VERSION/g" docs/releases/v${VERSION}.md
shell: bash
- name: Commit changes
run: |
VERSION=$(node -p "require('./package.json').version")
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add docs/releases/v*.md package*.json
git commit -m "chore(release): v${VERSION}" || echo "No changes to commit"
git push