Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t authored Nov 19, 2021
1 parent 9709a7b commit 9d63f1c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish release

on:
push:
tags:
- '*'

jobs:
release:
name: Publish release
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest --no-dev
- name: Cleanup unnecessary files
run: rm -rf .git .github .editorconfig .gitattributes .gitignore composer.json composer.lock phpcs.xml.dist phpunit.xml.dist tests
- name: Get the version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
shell: bash
- name: Create subfolder
run: mkdir acorn && mv ./* acorn/ 2>/dev/null
continue-on-error: true
- name: Create distributable zip file
uses: montudor/[email protected]
with:
args: zip -qq -r9 acorn.zip acorn
- name: Upload zip as release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: acorn.zip
asset_name: acorn-${{ steps.get_version.outputs.version }}-php-${{ matrix.php-versions }}.zip
tag: ${{ github.ref }}
overwrite: true

0 comments on commit 9d63f1c

Please sign in to comment.