chore: ensure we can make releases #42
Workflow file for this run
This file contains hidden or 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: [ 'v*' ] # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| permissions: {} | |
| jobs: | |
| linting: | |
| name: "Release a new ZIP" | |
| runs-on: "ubuntu-latest" | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5" # v6.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: "Setup PHP, with composer and extensions" | |
| uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # v2.37.0 | |
| with: | |
| php-version: "8.0" | |
| extensions: "mbstring, xml, ctype, iconv, intl, gd" | |
| tools: "composer:v2" | |
| - name: "Get composer cache directory" | |
| id: "composer-cache" | |
| run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' | |
| - name: "Cache composer dependencies" | |
| uses: "actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306" # v5.0.3 | |
| with: | |
| path: "${{ steps.composer-cache.outputs.dir }}" | |
| key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}" | |
| restore-keys: "${{ runner.os }}-composer-" | |
| lookup-only: true | |
| - name: "Validate composer" | |
| run: "composer validate" | |
| - name: "Install Composer dependencies" | |
| run: "composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader" | |
| # Zip the module | |
| - name: "Make zip" | |
| run: "make" | |
| # Make a release from the tag and upload the zip | |
| - name: "Create Release" | |
| id: "create_release" | |
| uses: "softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe" # v2.6.1 | |
| env: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| with: | |
| name: "Release ${{ github.ref_name }}" | |
| files: "./build/btcpay.zip" | |
| fail_on_unmatched_files: true | |
| generate_release_notes: true |