diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml new file mode 100644 index 0000000..85cbabb --- /dev/null +++ b/.github/workflows/artifact.yml @@ -0,0 +1,41 @@ +name: Artifact + +on: + workflow_dispatch: + pull_request: + types: [opened, reopened] + branches: [master] + +jobs: + artifact: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Get Info + run: | + echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT + id: info + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + - name: Install Dependencies + run: | + python3 -m pip install --upgrade build + pip install -r requirements.txt + - name: Build Artifact + run: | + cd ${{ github.workspace }} + cwd=$(pwd) + git submodule update --init --recursive + rm -rf ./.git/ + rm .gitignore + rm .gitmodules + python3 -m build + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: onlyoffice.plone-${{ steps.info.outputs.version }} + path: ${{ github.workspace }}/dist/onlyoffice.plone-${{ steps.info.outputs.version }}.tar.gz \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d5d5134 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + branches: [master] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Get Info + run: | + echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT + 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 Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + - name: Install Dependencies + run: | + python3 -m pip install --upgrade build + pip install -r requirements.txt + - name: Build Artifact + run: | + cd ${{ github.workspace }} + cwd=$(pwd) + git submodule update --init --recursive + rm -rf ./.git/ + rm .gitignore + rm .gitmodules + python3 -m build + - name: Create Release + uses: ncipollo/release-action@v1 + id: create_release + with: + artifacts: "${{ github.workspace }}/dist/onlyoffice.plone-${{ steps.info.outputs.version }}.tar.gz" + bodyFile: RELEASE.md + tag: v${{ steps.info.outputs.version }} \ No newline at end of file