-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (49 loc) · 1.81 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
on:
push:
branches: [master]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Zip
run: sudo apt-get install zip
- name: Get Info
run: |
echo "version=$(awk '/##/{gsub(/[^0-9]+.[^0-9]+.[^0-9]/, "", $NF); print $NF}' CHANGELOG.md | awk 'NR==1{print $1}')" >> $GITHUB_OUTPUT
id: info
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
mkdir -p ./onlyoffice
rsync -av --exclude='onlyoffice' ./ ./onlyoffice
cd ./onlyoffice
composer install
rm -rf .github/
rm -rf .git/
rm .gitignore
rm .gitmodules
rm -rf ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-templates
mv ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-formats/onlyoffice-docs-formats.json ./vendor/onlyoffice/docs-integration-sdk/resources/assets/document-formats/onlyoffice-docs-formats.txt
rm ./composer.json
rm ./composer.lock
find ./vendor -type f -iname '*.json' -delete
find ./vendor -type f -iname '*.lock' -delete
find ./vendor -type f -iname 'LICENSE' -delete
cd ./assets
rm .git
cd $cwd
awk '/## [0-9]/{p++} p; /## [0-9]/{if (p > 1) exit}' CHANGELOG.md | awk 'NR>2 {print last} {last=$0}' > RELEASE.md
- name: Pack Artifact
run: zip -r onlyoffice onlyoffice
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
with:
artifacts: "onlyoffice.zip"
bodyFile: RELEASE.md
tag: v${{ steps.info.outputs.version }}