Skip to content

Instantly share code, notes, and snippets.

@jeffreyvr
Created October 15, 2024 05:57
Show Gist options
  • Save jeffreyvr/354edee3519740c4cf138242d0788763 to your computer and use it in GitHub Desktop.
Save jeffreyvr/354edee3519740c4cf138242d0788763 to your computer and use it in GitHub Desktop.
WP Theme release workflow
name: Create release
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-dev -o -q
- name: Zip Folder
run: |
shopt -s extglob
mkdir ${{ github.event.repository.name }} && mv !(${{ github.event.repository.name }}) ${{ github.event.repository.name }}/ && \
zip -r [email protected] ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "${{ github.event.repository.name }}_${{ github.ref_name }}.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment