feat: release artifacts #100
parent
e3787edff9
commit
f191172238
|
@ -0,0 +1,68 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest]
|
||||||
|
php-versions: ["7.4"]
|
||||||
|
name: Release on PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
env:
|
||||||
|
fail-fast: true
|
||||||
|
|
||||||
|
- name: Validate composer
|
||||||
|
run: composer validate
|
||||||
|
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
id: get_version
|
||||||
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||||
|
|
||||||
|
- name: Archive dev
|
||||||
|
uses: thedoctor0/zip-release@master
|
||||||
|
with:
|
||||||
|
type: "zip"
|
||||||
|
filename: "${{ steps.get_version.outputs.VERSION }}-dev.zip"
|
||||||
|
exclusions: "/*.git/* /*.github/*"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --prefer-dist --no-progress --classmap-authoritative --ignore-platform-reqs
|
||||||
|
|
||||||
|
- name: Archive release
|
||||||
|
uses: thedoctor0/zip-release@master
|
||||||
|
with:
|
||||||
|
type: "zip"
|
||||||
|
filename: "${{ steps.get_version.outputs.VERSION }}.zip"
|
||||||
|
exclusions: "/*.git/* /*.github/*"
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
allowUpdates: true
|
||||||
|
removeArtifacts: true
|
||||||
|
artifacts: "${{ steps.get_version.outputs.VERSION }}.zip,${{ steps.get_version.outputs.VERSION }}-dev.zip"
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue