-
Notifications
You must be signed in to change notification settings - Fork 23
53 lines (46 loc) · 1.6 KB
/
buildAndDeployPhar.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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: Build and deploy PHAR
on:
push:
tags:
- "*"
jobs:
build:
name: Build PHAR-File
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, intl, readline
tools: composer:v2
- name: Prepare binary with version
run: |
VERSION=$(echo ${GITHUB_REF} | cut -d / -f 3)
cat bin/keep-a-changelog.dist | sed -e "s/%VERSION%/${VERSION}/" > bin/keep-a-changelog
- name: Build Phar
run: composer buildphar
- name: Sign Phar
env:
DECRYPT_KEY: ${{ secrets.DECRYPT_KEY }}
SIGN_KEY: ${{ secrets.SIGN_KEY }}
run: |
export GPG_TTY=$(tty)
echo $DECRYPT_KEY
echo Decrypting key
gpg --batch --yes --passphrase $DECRYPT_KEY KeepAChangelogSigning.asc.gpg && gpg --batch --yes --import KeepAChangelogSigning.asc
echo Signing Artifact
gpg --batch --yes --pinentry-mode loopback --passphrase $SIGN_KEY -u 9A2577FF9A688FAF --armor --detach-sig build/keep-a-changelog.phar
- name: Prepare Release-Info
run: |
./bin/keep-a-changelog version:show $(echo $GITHUB_REF | cut -d / -f 3) > release.note
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "build/*"
bodyfile: release.note
name: "keep-a-changelog ${{ github.event.release.tag_name }}"
token: ${{ secrets.GITHUB_TOKEN }}