-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (77 loc) · 2.84 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
87
88
89
name: Deploy app
on:
release:
types: [published]
jobs:
container:
runs-on: ubuntu-latest
container: nextcloud
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: followme
- name: Create tar
run: |
cd followme && make appstore
- name: load app
run: |
cd followme
tar xzvf ./build/artifacts/appstore/followme.tar.gz --directory /usr/src/nextcloud/apps/
- name: Generate key
env:
APP_KEY: ${{ secrets.APP_PRIVATE_KEY }}
APP_CRT: ${{ secrets.APP_CERTIFICATE }}
run: |
echo -n "$APP_KEY" > /usr/src/nextcloud/p.key
echo -n "$APP_CRT" > /usr/src/nextcloud/p.crt
- name: sign app
env:
APP_KEY: ${{ secrets.APP_PRIVATE_KEY }}
run: |
cd /usr/src/nextcloud
php occ integrity:sign-app --privateKey=p.key --certificate=p.crt --path=/usr/src/nextcloud/apps/followme
cd /usr/src/nextcloud/apps
tar cvzf followme.tar.gz followme
echo -n "$APP_KEY" > /usr/src/nextcloud/apps/p.key
openssl dgst -sha512 -sign /usr/src/nextcloud/apps/p.key /usr/src/nextcloud/apps/followme.tar.gz | openssl base64 > /usr/src/nextcloud/apps/shasum.txt
cat ./shasum.txt
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Upload app tarball to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release_app
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /usr/src/nextcloud/apps/followme.tar.gz
asset_name: followme.tar.gz
tag: ${{ steps.get_version.outputs.VERSION }}
overwrite: true
- name: Upload shasum to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release_shasum
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /usr/src/nextcloud/apps/shasum.txt
asset_name: shasum.${{ steps.get_version.outputs.VERSION }}.txt
tag: ${{ steps.get_version.outputs.VERSION }}
overwrite: true
- name: Sleep for 1 minute
run: sleep 60s
shell: bash
publish:
runs-on: ubuntu-latest
needs: [container]
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Upload app to Nextcloud appstore
uses: R0Wi/nextcloud-appstore-push-action@v1
with:
app_name: followme
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
download_url: https://github.com/Adacis/followme/releases/download/${{ steps.get_version.outputs.VERSION }}/followme.tar.gz
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
nightly: false