-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from soderlind/update
Enhance GitHub Actions workflow for manual zip builds with improved i…
- Loading branch information
Showing
1 changed file
with
28 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,56 @@ | ||
name: Manually Build release zip | ||
name: Manually Build Release Zip | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to deploy' | ||
description: 'Release tag (e.g. v1.0.0)' | ||
required: true | ||
type: string | ||
default: '' | ||
zip: | ||
description: 'Name of zip to deploy' | ||
description: 'Output zip filename (e.g. my-plugin.zip)' | ||
required: true | ||
type: string | ||
default: '' | ||
|
||
jobs: | ||
build: | ||
name: Build release zip | ||
create-release: | ||
name: Create Release Package | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build plugin # Remove or modify this step as needed | ||
- name: Build plugin | ||
run: | | ||
composer install --no-dev | ||
if ! composer install --no-dev; then | ||
echo "::error::Plugin build failed" | ||
exit 1 | ||
fi | ||
- name: Archive Release | ||
uses: thedoctor0/zip-release@0.7.5 | ||
- name: Create zip archive | ||
uses: thedoctor0/zip-release@0.7.6 | ||
with: | ||
type: 'zip' | ||
filename: 'wp-loupe.zip' | ||
filename: ${{ github.event.inputs.zip }} | ||
exclusions: '*.git* .editorconfig composer* *.md' | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
- name: Upload to release | ||
uses: softprops/action-gh-release@v2 | ||
id: upload | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: wp-loupe.zip | ||
files: ${{ github.event.inputs.zip }} | ||
tag_name: ${{ github.event.inputs.tag }} | ||
fail_on_unmatched_files: true | ||
|
||
- name: Generate build provenance attestation | ||
uses: johnbillion/action-wordpress-plugin-attestation@0.7.0 | ||
with: | ||
zip-path: ${{ steps.upload.outputs.upload_url }} | ||
|
||
- name: Cleanup | ||
if: always() | ||
run: rm -f ${{ github.event.inputs.zip }} |