-
Notifications
You must be signed in to change notification settings - Fork 52
57 lines (47 loc) · 1.62 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
name: Release
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
ini-values: phar.readonly=Off
- name: Install dependencies
run: composer install --no-dev
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Set version string
run: sed -i -e "s/__VERSION__/${{ steps.get_version.outputs.VERSION }}/g" src/Application.php
- name: Build
run: ./bin/build.sh
- name: Deploy
run: |
mv sw.phar sw.phar.tmp
git config --global user.email "[email protected]"
git config --global user.name "shopwareBot"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git checkout -t origin/gh-pages -f
mv sw.phar.tmp sw.phar
sha1sum sw.phar > sw.phar.version
git add sw.phar sw.phar.version
git commit -m 'Rebuilt phar; version: ${{ steps.get_version.outputs.VERSION }}'
git push origin gh-pages:gh-pages
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: sw.phar
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false