Update README.md #38
This file contains 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 & Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-latest ] | |
php: [ 8.2 ] | |
stability: [ prefer-stable ] | |
name: ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Prepare Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Damien Criado" | |
- name: Install dependencies | |
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
- name: Test building app | |
run: php dock app:build | |
- name: Standard Version | |
run: | | |
sudo npm i -g standard-version | |
standard-version | |
- name: Get latest tag | |
id: latest-tag | |
run: echo "::set-output name=value::$(git describe --tags --abbrev=0)" | |
- name: Extract release notes from changelog | |
uses: yashanand1910/[email protected] | |
id: changelog | |
with: | |
changelog_path: ./CHANGELOG.md | |
version: ${{ steps.latest-tag.outputs.version }} | |
- name: Build app | |
run: php dock app:build --build-version=$VERSION | |
env: | |
VERSION: ${{ steps.latest-tag.outputs.value }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
if: ${{ steps.changelog.outputs.release_notes != '' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.latest-tag.outputs.value }} | |
release_name: ${{ steps.latest-tag.outputs.value }} | |
body: ${{ steps.changelog.outputs.release_notes }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
if: ${{ steps.changelog.outputs.release_notes != '' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: builds/dock | |
asset_name: dock | |
asset_content_type: application/octet-stream |