Skip to content

Commit 0f4f38e

Browse files
committed
ci: add actions release
1 parent 0647c16 commit 0f4f38e

File tree

5 files changed

+106
-37
lines changed

5 files changed

+106
-37
lines changed

.github/label-settings/labeler.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
js:
2+
- 'src/**/*.js'
3+
test:
4+
- '**/tests'
5+
- '**/_tests_'
6+
- '**/*.spec.js'
7+
- '**/*.test.js'
8+
9+
doc:
10+
- '**/*.md'
11+
12+
configuration:
13+
- '**/*.yml'
14+
- '**/*.json'
15+
- '**/.env'
16+
- '**/.env.**'
17+
- '**/knexfile.js'
18+
- '**/jest.config.js'
19+
20+
dependencies:
21+
- '**/package.json'
22+
- '**/build.gradle'
23+
- '**/.*ignore'
24+
25+
github-actions:
26+
- '**/.github/workflows/**'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
feature: ['feature/*', 'feat/*', 'features/*']
2+
bug: ['fix/*', 'bug/*', 'bugfix/*']
3+
chore: chore/*
4+
fixed-branch: fixed-branch-name
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Labeler
2+
on:
3+
- pull_request_target
4+
jobs:
5+
pattern-labaler:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/labeler@v2
9+
with:
10+
configuration-path: .github/label-settings/labeler.yml
11+
repo-token: ${{ secrets.GH_TOKEN }}
12+
branch-name-labeler:
13+
runs-on: ubuntu-18.04
14+
steps:
15+
- uses: TimonVS/pr-labeler-action@v3
16+
with:
17+
configuration-path: .github/label-settings/name-pattern-labeler.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- next
7+
- beta
8+
- alpha
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 'lts/*'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Get version from package.json before release step
28+
id: get_version_before_release
29+
run: echo "::set-output name=version::$(npm run get-version --silent)"
30+
31+
- name: Release
32+
id: release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
GIT_AUTHOR_NAME: bot-flowbuild
37+
GIT_AUTHOR_EMAIL: bot.flowbuild@gmail.com
38+
GIT_COMMITTER_NAME: bot-flowbuilld
39+
GIT_COMMITTER_EMAIL: bot.flowbuild@gmail.com
40+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
41+
run: npm run release
42+
43+
- name: Get version from package.json after release step
44+
id: get_version_after_release
45+
run: echo "::set-output name=version::$(npm run get-version --silent)"
46+
47+
- name: Create Pull Request with updated package files
48+
if: steps.get_version_before_release.outputs.version != steps.get_version_after_release.outputs.version
49+
uses: peter-evans/create-pull-request@v3
50+
with:
51+
token: ${{ secrets.GH_TOKEN }}
52+
commit-message: 'chore(release): ${{ steps.get_version_after_release.outputs.version }}'
53+
committer: bot-flowbuilld <bot.flowbuild@gmail.com>
54+
author: bot-flowbuilld <bot.flowbuild@gmail.com>
55+
title: 'chore(release): ${{ steps.get_version_after_release.outputs.version }}'
56+
body: 'Version bump in package.json and package-lock.json for release [${{ steps.get_version_after_release.outputs.version }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.get_version_after_release.outputs.version }})'
57+
branch: version-bump/${{ steps.get_version_after_release.outputs.version }}

.github/workflows/release.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)