Workflow file for this run
This file contains hidden or 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
name: Build and Distribute SQLite Command Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Install dependencies | |
run: composer install --no-dev --optimize-autoloader --ignore-platform-reqs | |
- name: Set release version | |
id: set_version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Create version file | |
run: echo "${{ env.RELEASE_VERSION }}" > version | |
- name: Create distribution | |
run: | | |
mkdir temp_dist | |
rsync -av \ | |
--exclude-from='.distignore' \ | |
--exclude='.git' \ | |
--exclude='.github' \ | |
--exclude='temp_dist' \ | |
. temp_dist/ | |
cp version temp_dist/ | |
- name: Create ZIP archive | |
run: | | |
cd temp_dist | |
zip -r ../wp-cli-sqlite-command-${{ env.RELEASE_VERSION }}.zip . | |
- name: Clean up | |
run: rm -rf temp_dist version | |
- name: Upload distribution as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wp-cli-sqlite-command-${{ env.RELEASE_VERSION }} | |
path: wp-cli-sqlite-command-${{ env.RELEASE_VERSION }}.zip | |
- name: Upload to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./wp-cli-sqlite-command-${{ env.RELEASE_VERSION }}.zip | |
asset_name: wp-cli-sqlite-command-${{ env.RELEASE_VERSION }}.zip | |
asset_content_type: application/zip |