-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (60 loc) · 2.17 KB
/
main.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
name: Build SFOS 4.6
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: coderus/sailfishos-platform-sdk-aarch64:4.6.0.13
steps:
- name: Setup and Check Environment
run: |
whoami
pwd
ls -la /home/mersdk
- name: Manual Checkout
run: |
cd /home/mersdk
git clone https://github.com/conradhuebler/harbour-tidalplayer.git
cd harbour-tidalplayer
git submodule update --init --recursive
ls -la
- name: Build noarch
working-directory: /home/mersdk/harbour-tidalplayer
env:
HOME: /home/mersdk
run: |
pwd
mb2 -t SailfishOS-4.6.0.13-aarch64 build
- name: Rename RPM to fixed name
run: |
cd /home/mersdk/harbour-tidalplayer/RPMS/
mv harbour-tidalplayer-*-1.aarch64.rpm "harbour-tidalplayer-master-1.noarch.rpm"
ls -la
- name: Install curl
run: |
sudo zypper --non-interactive install curl
- name: Upload to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd /home/mersdk/harbour-tidalplayer/RPMS/
# Erst altes Asset löschen falls vorhanden
ASSET_ID=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/conradhuebler/harbour-tidalplayer/releases/148043359/assets" | \
grep -B 2 '"name": "harbour-tidalplayer-master-1.noarch.rpm"' | \
grep '"id":' | sed 's/.*"id": \([0-9]*\).*/\1/')
if [ ! -z "$ASSET_ID" ]; then
curl -X DELETE \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/conradhuebler/harbour-tidalplayer/releases/assets/$ASSET_ID"
fi
# Neues Asset hochladen
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/x-rpm" \
--data-binary @"harbour-tidalplayer-master-1.noarch.rpm" \
"https://uploads.github.com/repos/conradhuebler/harbour-tidalplayer/releases/148043359/assets?name=harbour-tidalplayer-master-1.noarch.rpm"