Skip to content

Commit 19123b4

Browse files
committed
Merge pull request 'ci: added create-tag.yml and release.yml' from ci/git-actions into master
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/docspace-react/pulls/4
2 parents 523337f + 8bb5ca4 commit 19123b4

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/create-tag.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create Tag
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths-ignore:
7+
- '.github/**'
8+
- '**/AUTHORS.md'
9+
- '**/LICENSE'
10+
- '**/README.md'
11+
12+
jobs:
13+
create-tag:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
- name: Get Info
19+
run: |
20+
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
21+
id: info
22+
- name: Create Tag
23+
run: |
24+
git config user.name "$GITHUB_ACTOR"
25+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
26+
git tag -a 'v${{ steps.info.outputs.version }}' -m 'Release/v${{ steps.info.outputs.version }}'
27+
git push origin 'v${{ steps.info.outputs.version }}'

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
- name: Install NodeJS
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
registry-url: 'https://registry.npmjs.org/'
22+
- name: Install dependencies
23+
run: npm install
24+
- name: Build project
25+
run: npm run rollup
26+
- name: Publish to npm
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
run: npm publish --access public
30+
- name: Get Info
31+
run: |
32+
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
33+
id: info
34+
- name: Generate Changelog
35+
run: |
36+
awk '/## [0-9]/{p++} p; /## [0-9]/{if (p > 1) exit}' CHANGELOG.md | awk 'NR>2 {print last} {last=$0}' > RELEASE.md
37+
- name: Create Release
38+
uses: ncipollo/release-action@v1
39+
id: create_release
40+
with:
41+
bodyFile: RELEASE.md
42+
tag: v${{ steps.info.outputs.version }}

0 commit comments

Comments
 (0)