diff --git a/.github/workflows/build-and-tag.yml b/.github/workflows/build-and-tag.yml deleted file mode 100644 index c7376f2..0000000 --- a/.github/workflows/build-and-tag.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and Tag -on: - push: - branches: - - 'trunk' - -jobs: - wordpress: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Composer dependencies - run: composer install --no-dev - - - name: Install Dependencies - run: npm install - - - name: Build Assets - run: npm run build - - - name: Setup - run: 'echo "VERSION=$(grep -Po ''\"version\": \"[0-9\\.]+\"'' package.json | grep -Po ''[0-9\\.]+'')" >> $GITHUB_ENV' - - - name: Tag - run: | - echo "Releasing version $VERSION ..." - git config user.name github-actions - git config user.email github-actions@github.com - git checkout -b "release-$VERSION" - git add -f dist/* - git commit -m "Release $VERSION" - git tag "$VERSION" - git push --tags - env: - TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/push-deploy.yml b/.github/workflows/push-deploy.yml index e12fc94..a511eef 100644 --- a/.github/workflows/push-deploy.yml +++ b/.github/workflows/push-deploy.yml @@ -9,12 +9,34 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Setup node version and npm cache + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install Node dependencies + run: npm install + + - name: Build plugin + run: npm run build - name: WordPress Plugin Deploy - if: "! github.event.release.prerelease" id: deploy uses: 10up/action-wordpress-plugin-deploy@stable + with: + generate-zip: true env: SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} \ No newline at end of file + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ github.workspace }}/${{ github.event.repository.name }}.zip + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip \ No newline at end of file