Skip to content

Commit

Permalink
chore: update github worflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane committed Jul 13, 2023
1 parent a650a5f commit 10f5771
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/merge-develop-in-main.yml

This file was deleted.

14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Create Release

on:
push:
branches:
- main
tags:
- "v*"

jobs:
build:
Expand Down Expand Up @@ -33,6 +33,14 @@ jobs:
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
branch: develop
commit_message: "docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
file_pattern: CHANGELOG.md

- name: Merge develop in main
uses: devmasx/merge-branch@master
with:
type: now
from_branch: develop
target_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
"build": "react-scripts build",
"release": "./scripts/release.sh"
},
"eslintConfig": {
"extends": [
Expand Down
17 changes: 17 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -e

# Get package.json version
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")

# Commit files
git add .
git commit -m "chore: release v$PACKAGE_VERSION"

# Create new git tag
git tag "v$PACKAGE_VERSION"
git tag -l

# Push to GitHub
git push origin develop
git push origin "v$PACKAGE_VERSION"

0 comments on commit 10f5771

Please sign in to comment.