Fix readme #12
Workflow file for this run
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
on: | |
push: | |
tags: | |
- 'v*' | |
name: Deployment | |
jobs: | |
build: | |
name: Github and WordPress releases | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.4 | |
tools: composer | |
env: | |
fail-fast: true | |
- name: Build project | |
env: | |
ZIP_NAME: campi-moduli-italiani-v${{ env.RELEASE_VERSION }}.zip | |
run: | | |
make bundle | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release v${{ env.RELEASE_VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/campi-moduli-italiani-v${{ env.RELEASE_VERSION }}.zip | |
asset_name: campi-moduli-italiani-v${{ env.RELEASE_VERSION }}.zip | |
asset_content_type: application/zip | |
- name: Sync with SVN | |
run: | | |
make svnsync | |
- name: Push to WordPress Plugin directory | |
env: | |
SVN_TAG: ${{ env.RELEASE_VERSION }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
run: | | |
make svnpush |