Merge branch 'master' of github.com:kelvinmo/simplejwt #8
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: Build and release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
extensions: bz2, Phar | |
ini-values: phar.readonly=0 | |
tools: composer | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: "composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "composer-" | |
- name: Install dependencies | |
run: composer update && composer install | |
- name: Install dependencies for build | |
run: composer bin build update && composer bin build install | |
- name: Build jwkstool.phar | |
run: composer phar | |
- name: Upload jwkstool.phar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jwkstool | |
path: bin/jwkstool.phar | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download jwkstool.phar | |
uses: actions/download-artifact@v3 | |
with: | |
name: jwkstool | |
- name: Get semantic version | |
id: semver | |
uses: booxmedialtd/[email protected] | |
with: | |
input_string: ${{ github.ref }} | |
version_extractor_regex: '\/v(.*)$' | |
- name: Get Changelog | |
id: changelog | |
uses: ocavue/[email protected] | |
with: | |
removeMarkdown: false | |
- name: Create Github release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: jwkstool.phar | |
body: ${{ steps.changelog.outputs.latestBody }} | |
prerelease: ${{ !!steps.semver.outputs.prerelease }} |