Skip to content

Commit 5de6139

Browse files
committed
CI: add manual trigger and update release strategy
1 parent 5975f4d commit 5de6139

1 file changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,47 @@ name: Deploy to WordPress.org
22
on:
33
release:
44
types: [ published ]
5+
workflow_dispatch:
6+
inputs:
7+
dry_run:
8+
description: "Prevent upload to wordpress.org (Dry Run)"
9+
default: true
10+
type: boolean
11+
512
jobs:
613
tag:
714
name: New release
815
runs-on: ubuntu-latest
916
steps:
1017
- name: Checkout code
11-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1219
- name: Mark github workspace as safe
1320
run: |
14-
git config --global --add safe.directory /app
15-
- name: Build
16-
id: build
17-
uses: php-actions/composer@v6
21+
git config --global --add safe.directory $GITHUB_WORKSPACE
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
1824
with:
19-
command: 'build'
25+
php-version: '8.2'
26+
tools: composer:v2
27+
28+
- name: Build
29+
run: composer build
2030
env:
21-
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ADD_TO_PROJECTS_PAT }}"} }'
31+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ADD_TO_PROJECTS_PAT }}"}}'
2232

2333
- name: WordPress Plugin Deploy
2434
id: deploy
2535
uses: 10up/action-wordpress-plugin-deploy@stable
2636
with:
2737
generate-zip: true
28-
dry-run: true
38+
dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}
2939
env:
3040
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
3141
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
3242
SLUG: gf-entries-in-excel
3343
ASSETS_DIR: assets
3444
- name: Upload release asset
35-
uses: actions/upload-release-asset@v1
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
if: ${{ github.event_name == 'release' }}
46+
uses: softprops/action-gh-release@v2
3847
with:
39-
upload_url: ${{ github.event.release.upload_url }}
40-
asset_path: ${{ steps.deploy.outputs.zip-path }}
41-
asset_name: ${{ github.event.repository.name }}.zip
42-
asset_content_type: application/zip
48+
files: ${{ steps.deploy.outputs.zip-path }}

0 commit comments

Comments
 (0)