Skip to content

Instantly share code, notes, and snippets.

@okwasniewski
Created September 6, 2021 09:25
Show Gist options
  • Save okwasniewski/f7fd39e1f65b3d2cc1de7f39eef58d55 to your computer and use it in GitHub Desktop.
Save okwasniewski/f7fd39e1f65b3d2cc1de7f39eef58d55 to your computer and use it in GitHub Desktop.
Create github release with composer dependencies automatically
name: "Release"
on:
push:
tags:
- "*"
env:
COMPOSER_FLAGS: "--no-dev --no-interaction"
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "intl"
ini-values: "memory_limit=-1"
php-version: "7.4"
- name: "Install dependencies from composer.lock using composer binary provided by system"
run: "composer install ${{ env.COMPOSER_FLAGS }}"
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: '${{ github.event.repository.name }}.zip'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Upload Release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ github.event.repository.name }}.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: ${{ github.event.repository.name }}.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment