Merge pull request 'Release/v1.4.0' from develop into master #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |