Merge pull request #50 from ONLYOFFICE/fix/actions-build #5
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: [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: | | |
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 }} |