Skip to content

Commit

Permalink
Merge pull request #1 from soderlind/update
Browse files Browse the repository at this point in the history
Enhance GitHub Actions workflow for manual zip builds with improved i…
  • Loading branch information
soderlind authored Jan 16, 2025
2 parents 4dc3e66 + 0375b1e commit bd1d845
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/manually-build-zip.yml
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 }}

0 comments on commit bd1d845

Please # to comment.