Merge pull request 'Release/2.1.1' (#3) from develop into master #11
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] | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Get Info | |
run: | | |
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT | |
id: info | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.2" | |
coverage: none | |
tools: composer, cs2pr | |
- name: Install Zip | |
run: sudo apt-get install zip | |
- name: Build Plugin | |
run: | | |
composer install | |
composer translations | |
rm -rf vendor | |
cd ${{ github.workspace }}/onlyoffice-docspace-wordpress-block | |
npm install | |
npm run build | |
rm -rf node_modules | |
rm -rf package.json | |
rm -rf package-lock.json | |
rm -rf .eslintrc | |
cd ${{ github.workspace }} | |
mkdir -p ./onlyoffice-docspace | |
rsync -av --exclude='onlyoffice-docspace' ./ ./onlyoffice-docspace | |
cd ./onlyoffice-docspace | |
rm -rf .github/ | |
rm -rf .git/ | |
rm .gitignore | |
rm composer.json | |
rm composer.lock | |
- name: Build Artifact | |
run: zip -r onlyoffice-docspace.zip onlyoffice-docspace/ | |
- name: Generate Changelog | |
run: | | |
awk '/## [0-9]/{p++} p; /## [0-9]/{if (p > 1) exit}' CHANGELOG.md | awk 'NR>2 {print last} {last=$0}' > RELEASE.md | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
id: create_release | |
with: | |
bodyFile: RELEASE.md | |
artifacts: "onlyoffice-docspace.zip" | |
tag: v${{ steps.info.outputs.version }} |