-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
106 lines (94 loc) · 3.44 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
name: Spotube Publish Binary
on:
workflow_dispatch:
inputs:
version:
description: Version to publish (x.x.x)
default: 3.0.0
required: true
dry_run:
description: Dry run
required: true
type: boolean
default: true
jobs:
description: Jobs to run (flathub,aur,winget,chocolatey)
required: true
type: string
default: "flathub,aur,winget,chocolatey"
jobs:
flathub:
runs-on: ubuntu-22.04
if: contains(inputs.jobs, 'flathub')
steps:
- uses: actions/checkout@v3
with:
repository: KRTirtho/com.github.KRTirtho.Spotube
token: ${{ secrets.FLATHUB_TOKEN }}
- uses: actions/checkout@v3
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 "krtirtho@gmail.com"
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@v3
- 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/github-actions-deploy-aur@v2.7.0
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/