-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
53 lines (45 loc) · 1.45 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
name: release
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
if [ -n "$VERSION" ]; then
echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
fi
env:
VERSION: ${{ inputs.version }}
- name: Build phar
run: php -d phar.readonly=0 bin/build -v"$RELEASE_VERSION"
- name: Sign phar
run: |
mkdir -p ~/.gnupg/
chmod 0700 ~/.gnupg/
echo "$GPG_SIGNING_KEY" > ~/.gnupg/private.key
gpg --import --no-tty --batch --yes ~/.gnupg/private.key
gpg -u [email protected] --batch --pinentry-mode loopback --passphrase "${GPG_PASSPHRASE}" --detach-sign --output deployer.phar.asc deployer.phar
env:
GPG_SIGNING_KEY: |
${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload phar
run: gh release upload v"${RELEASE_VERSION}" deployer.phar
env:
GH_TOKEN: ${{ github.token }}
- name: Upload signature
run: gh release upload v"${RELEASE_VERSION}" deployer.phar.asc
env:
GH_TOKEN: ${{ github.token }}