-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 2.56 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
name: Release
on:
release:
types: [released]
env:
APP_NAME: files_external_ethswarm
CERT_DIRECTORY: $HOME/.nextcloud/certificates
jobs:
release:
runs-on: ubuntu-latest
name: Release new version
steps:
- name: Set up PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
tools: composer
- name: Checkout NC server
uses: actions/checkout@v2
with:
repository: nextcloud/server
ref: "master"
- name: Checkout NC submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Checkout app
uses: actions/checkout@v2
with:
path: ${{ env.APP_NAME }}
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
path: ./${{ env.APP_NAME }}/
fallbackNode: "^14"
fallbackNpm: "^7"
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Run build
run: |
mkdir -p ${{ env.CERT_DIRECTORY }}
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.CERT_DIRECTORY }}/${{ env.APP_NAME }}.key
echo "${{ secrets.APP_CERT }}" > ${{ env.CERT_DIRECTORY }}/${{ env.APP_NAME }}.crt
cd ${{ env.APP_NAME }}
make appstore
rm -rf ${{ env.CERT_DIRECTORY }}
- name: Upload tarball to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.APP_NAME }}/build/${{ env.APP_NAME }}.tar.gz
asset_name: ${{ env.APP_NAME }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
- name: Upload app to Nextcloud appstore
uses: R0Wi/nextcloud-appstore-push-action@v1
with:
app_name: ${{ env.APP_NAME }}
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}