Skip to content

Commit

Permalink
Merge pull request #8 from mato533/release/test
Browse files Browse the repository at this point in the history
[RELEASE] v1.0.6
  • Loading branch information
mato533 authored Jun 17, 2023
2 parents 01ce59d + 3100d59 commit 1b7974e
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/RELEASE_WORKFLOW_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Description

Auto-generated pull request to master branch for release
38 changes: 38 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
pull_request:
branches:
- master
types: [closed]

jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_USER: "github-actions[bot]"

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"
- run: git config --local user.email "${{ env.GH_EMAIL }}"
- run: git config --local user.name "${{ env.GH_USER }}"

- run: echo test
- run: echo "${{ github.event.pull_request.head.ref }}"

- run: echo "${{ github.event.pull_request.title }}"
- run: echo "APP_VERSION=$(echo ${{ github.event.pull_request.title }} |grep -o -E "([0-9]+\.){1}[0-9]+(\.[0-9]+)?" | head -n1)">>"${GITHUB_ENV}"
- run: |
APP_VERSION=$(echo ${{ github.event.pull_request.title }} |grep -o -E "([0-9]+\.){1}[0-9]+(\.[0-9]+)?" | head -n1)"
if [ ! -n "${APP_VERSION}" ]
then
exit 255
fi
- run: |
git tag "v${APP_VERSION}"
git push origin "v${APP_VERSION}"
63 changes: 63 additions & 0 deletions .github/workflows/pre-release-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Pre-release tasks

on:
push:
branches:
- release/**
tags:
- "!*"

jobs:
pre-releas-task:
if: "${{ contains(github.event.head_commit.message, 'release:') }}"

runs-on: ubuntu-latest

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_USER: "github-actions[bot]"

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"

- run: echo "CHANGELOG">>./test.txt
- run: echo lint
- run: echo "APP_VERSION=$(echo ${{ github.event.head_commit.message }} |grep -o -E "([0-9]+\.){1}[0-9]+(\.[0-9]+)?" | head -n1)">>"${GITHUB_ENV}"
- run: yarn version --new-version "${{ env.APP_VERSION }}" --no-git-tag-version
- run: git config --local user.email "${{ env.GH_EMAIL }}"
- run: git config --local user.name "${{ env.GH_USER }}"
- run: |
git add -N .
if ! git diff --exit-code --quiet
then
git add .
git commit -m "Update"
git push
fi
- run: echo "${{ env.APP_VERSION }}"
- run: echo "PR_TITLE=[RELEASE] v${{ env.APP_VERSION }}">>"${GITHUB_ENV}"
- run: echo "PR_COUNT=$(gh pr list -S '${{ env.PR_TITLE }}' in:title | wc -l)" >>"${GITHUB_ENV}"

- name: Create pull request(for master)
if: ${{ env.PR_COUNT }} == 0
run: |
gh pr create \
-B master \
-t '${{ env.PR_TITLE }}' \
-a ${{ github.actor }} \
--body-file ./.github/RELEASE_WORKFLOW_TEMPLATE.md
- name: Create pull request(for develop)
if: ${{ env.PR_COUNT }} == 0
run: |
gh pr create \
-B develop \
-t '${{ env.PR_TITLE }}' \
-a ${{ github.actor }} \
--body-file ./.github/RELEASE_WORKFLOW_TEMPLATE.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ edit1
edit2

edit3

edot4
51 changes: 51 additions & 0 deletions changelog.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
disableEmoji: true,
list: ['test', 'feat', 'fix', 'chore', 'docs', 'refactor', 'style', 'ci', 'perf','release'],

types: {
chore: {
description: 'Build process or auxiliary tool changes',
value: 'chore'
},
ci: {
description: 'CI related changes',
value: 'ci'
},
docs: {
description: 'Documentation only changes',
value: 'docs'
},
feat: {
description: 'A new feature',
value: 'feat'
},
fix: {
description: 'A bug fix',
value: 'fix'
},
perf: {
description: 'A code change that improves performance',
value: 'perf'
},
refactor: {
description: 'A code change that neither fixes a bug or adds a feature',
value: 'refactor'
},
release: {
description: 'Create a release commit',
value: 'release'
},
style: {
description: 'Markup, white-space, formatting, missing semi-colons...',
value: 'style'
},
test: {
description: 'Adding missing tests',
value: 'test'
},
release: {
description: 'Releas version',
value: 'release'
}
},
};
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "ci-test-project",
"version": "1.0.2",
"main": "index.js",
"repository": "https://github.com/mato533/test1.git",
"author": "mato533 <[email protected]>",
"license": "MIT",
"devDependencies": {
"typescript": "^5.1.3"
}
}
4 changes: 4 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CHANGELOG
CHANGELOG
CHANGELOG
CHANGELOG
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


typescript@^5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==

0 comments on commit 1b7974e

Please sign in to comment.