-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
137 lines (121 loc) · 4.48 KB
/
spotube-publish-binary.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Spotube Publish Binary
on:
workflow_dispatch:
inputs:
version:
description: Version to publish (x.x.x)
default: 3.8.0
required: true
dry_run:
description: Dry run
required: true
type: boolean
default: true
jobs:
description: Jobs to run (flathub,aur,winget,chocolatey,playstore)
required: true
type: string
default: "flathub,aur,winget,chocolatey,playstore"
jobs:
flathub:
runs-on: ubuntu-22.04
if: contains(inputs.jobs, 'flathub')
steps:
- uses: actions/checkout@v4
with:
repository: KRTirtho/com.github.KRTirtho.Spotube
token: ${{ secrets.FLATHUB_TOKEN }}
- uses: actions/checkout@v4
with:
path: spotube
- name: Update flathub version
run: |
python3 spotube/scripts/update_flathub_version.py ${{ inputs.version }}
rm -rf spotube
git config --global user.email "[email protected]"
git config --global user.name "Kingkor Roy Tirtho"
git add .
git commit -m "v${{ inputs.version }} Update"
git branch update-${{ inputs.version }}
git switch update-${{ inputs.version }}
- name: Push to flathub
if: ${{ !inputs.dry_run }}
run: git push -u origin update-${{ inputs.version }}
aur:
runs-on: ubuntu-22.04
if: contains(inputs.jobs, 'aur')
steps:
- uses: actions/checkout@v4
- uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/v${{ inputs.version }} # mind the "v" prefix
file: spotube-linux-${{inputs.version}}-x86_64.tar.xz
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update PKGBUILD versions
run: |
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ inputs.version }}/" aur-struct/PKGBUILD
sed -i "s/%{{PKGREL}}%/1/" aur-struct/PKGBUILD
sed -i "s/%{{LINUX_MD5}}%/`md5sum spotube-linux-${{inputs.version}}-x86_64.tar.xz | awk '{print $1}'`/" aur-struct/PKGBUILD
- name: Release to AUR
if: ${{ !inputs.dry_run }}
uses: KSXGitHub/[email protected]
with:
pkgname: spotube-bin
pkgbuild: aur-struct/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Updated to v${{ inputs.version }}
winget:
runs-on: windows-latest
if: contains(inputs.jobs, 'winget')
steps:
- name: Release winget package
if: ${{ !inputs.dry_run }}
uses: vedantmgoyal2009/winget-releaser@v2
with:
version: ${{ inputs.version }}
release-tag: v${{ inputs.version }}
identifier: KRTirtho.Spotube
token: ${{ secrets.WINGET_TOKEN }}
chocolatey:
runs-on: windows-latest
if: contains(inputs.jobs, 'chocolatey')
steps:
- uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/v${{ inputs.version }} # mind the "v" prefix
file: Spotube-windows-x86_64.nupkg
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Chocolatey
run: choco apikey -k ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/
- name: Publish to Chocolatey Repository
if: ${{ !inputs.dry_run }}
run: choco push Spotube-windows-x86_64.nupkg --source https://push.chocolatey.org/
playstore:
runs-on: ubuntu-latest
if: contains(inputs.jobs, 'playstore')
steps:
- name: Tagname (workflow dispatch)
run: echo 'TAG_NAME=${{inputs.version}}' >> $GITHUB_ENV
- uses: robinraju/release-downloader@main
with:
repository: KRTirtho/spotube
tag: v${{ env.TAG_NAME }}
tarBall: false
zipBall: false
out-file-path: dist
fileName: "Spotube-playstore-all-arch.aab"
- name: Create service-account.json
run: |
echo "${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_BASE64 }}" | base64 -d > service-account.json
- name: Upload Android Release to Play Store
if: ${{!inputs.dry_run}}
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ./service-account.json
releaseFiles: ./dist/Spotube-playstore-all-arch.aab
packageName: oss.krtirtho.spotube
track: production
status: draft
releaseName: ${{ env.TAG_NAME }}