-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
53 lines (43 loc) · 1.44 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:
- created
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
- name: Build phar
run: php -d phar.readonly=0 bin/build -v"$RELEASE_VERSION"
- name: Upload phar
run: gh release upload ${{ github.event.release.tag_name }} deployer.phar
- name: Add deployer.phar
run: |
set -x
git checkout -b dist
mv deployer.phar dep
chmod +x dep
git add -f dep
- name: Remove obsolete files & dirs
run: |
set -x
git rm -r .github/ bin/ docs/ tests/ *.lock *.yaml *.xml *.neon
- name: Update composer.json
run: |
set -x
cat composer.json | jq 'del(.autoload) | del(.scripts) | del(.require) | del(."require-dev") | setpath(["bin"]; "dep")' > composer-new.json
mv composer-new.json composer.json
git add composer.json
- name: Push release tag
run: |
set -x
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git commit -m "Deployer $RELEASE_VERSION"
git tag "v$RELEASE_VERSION" --force
git push origin "v$RELEASE_VERSION" --force