-
Notifications
You must be signed in to change notification settings - Fork 18
86 lines (71 loc) · 2.17 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build and release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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@v4
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@v4
with:
name: jwkstool
path: bin/jwkstool.phar
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download jwkstool.phar
uses: actions/download-artifact@v4
with:
name: jwkstool
- name: Get version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Get semantic version
id: semver
uses: madhead/semver-utils@v4
with:
version: ${{ steps.version.outputs.version }}
- name: Get Changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.version.outputs.version }}
path: ./CHANGELOG.md
- name: Create Github release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: jwkstool.phar
body: ${{ steps.changelog.outputs.changes }}
prerelease: ${{ !!steps.semver.outputs.prerelease }}