Skip to content

Merge pull request #51 from ONLYOFFICE/fix/actions-build #6

Merge pull request #51 from ONLYOFFICE/fix/actions-build

Merge pull request #51 from ONLYOFFICE/fix/actions-build #6

Workflow file for this run

name: Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Info
run: |
echo "::set-output name=version::$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md)"
id: info
- 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: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Zip
run: sudo apt-get install zip
- name: Build Plugin
run: |
git submodule update --init --recursive
composer install --no-dev
cd ${{ github.workspace }}/onlyoffice-wordpress-block
npm install
npm run build
rm -rf node_modules
cd ${{ github.workspace }}
mkdir -p ./onlyoffice
rsync -av --exclude='onlyoffice' ./ ./onlyoffice
cd ./onlyoffice
rm -rf .github/
rm -rf .git/
rm .gitignore
- name: Build Artifact
run: zip -r onlyoffice.zip onlyoffice/
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
with:
bodyFile: RELEASE.md
artifacts: "onlyoffice.zip"
tag: v${{ steps.info.outputs.version }}