Set write permissions for release workflow #5
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
BOX_VERSION: '4.6.2' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ['8.3'] | |
arch: ['x86_64'] | |
system: ['linux'] | |
steps: | |
- name: 'Checkout Code' | |
uses: 'actions/checkout@v4' | |
- name: 'Setup PHP' | |
uses: 'shivammathur/setup-php@v2' | |
with: | |
php-version: '8.3' | |
extensions: intl, zip, zlib | |
coverage: none | |
ini-values: memory_limit=1G, phar.readonly=0 | |
- name: 'Install Project Dependencies' | |
run: composer install --no-interaction --no-ansi --no-progress | |
- name: 'Install Box' | |
run: | | |
wget \ | |
"https://github.com/humbug/box/releases/download/${BOX_VERSION}/box.phar" \ | |
--quiet \ | |
-O ./box | |
chmod +x ./box | |
sudo mv ./box /usr/local/bin | |
- name: 'Compile the application' | |
run: | | |
vendor/bin/castor repack --os=${{ matrix.system }} --app-name=beaver --app-version=${{ github.ref_name }} | |
vendor/bin/castor compile beaver.linux.phar --php-version=${{ matrix.php }} --arch=${{ matrix.arch }} --os=${{ matrix.system }} | |
- name: 'Move applications' | |
run: mv beaver.* ./bin/ | |
- name: 'Create Release' | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ github.ref_name }} | |
tag: ${{ github.ref_name }} | |
body: 'Next stable release.' | |
allowUpdates: true | |
artifacts: 'bin/*' | |
artifactContentType: application/x-php |