-
-
Notifications
You must be signed in to change notification settings - Fork 107
176 lines (165 loc) · 5.66 KB
/
deploy-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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Deploy Release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Download Releases
uses: robinraju/release-downloader@v1.7
with:
repository: "voxelum/x-minecraft-launcher"
tag: ${{ github.event.release.tag_name }}
fileName: "*"
out-file-path: build
- name: Upload to Azure
uses: ci010/upload-blob-to-azure@master
env:
AZURE_ACCOUNT_KEY: ${{ secrets.AZURE_ACCOUNT_KEY }}
with:
account: xmcl
container: releases
directory: ./build
- name: Update Web Page
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Deploy
token: ${{ secrets.PAT_GITHUB_TOKEN }}
ref: 'master'
repo: 'voxelum/xmcl-page'
- name: Create release version file
run: |
mkdir releases
echo ${{ github.event.release.tag_name }} > ./releases/VERSION
cat << EOF > ./releases/latest_version.json
${{ toJSON(github.event.release) }}
EOF
- name: Upload release version file to Azure
uses: ci010/upload-blob-to-azure@master
env:
AZURE_ACCOUNT_KEY: ${{ secrets.AZURE_ACCOUNT_KEY }}
with:
account: xmcl
container: releases
directory: ./releases
notify:
needs:
- publish
name: Notify Kook and discord
runs-on: ubuntu-latest
steps:
- name: Publish Release Notification
uses: voxelum/discord-kook-notify-action@main
with:
version: ${{ github.event.release.tag_name }}
token: ${{ secrets.KOOK_BOT_TOKEN }}
discord: ${{ secrets.DISCORD_WEBHOOK }}
update-brew:
needs:
- publish
name: Update Brew
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
repository: Voxelum/homebrew-xmcl
path: homebrew-xmcl
- uses: actions/github-script@v6
name: Update Brew Formula
with:
result-encoding: string
script: |
const version = '${{ github.event.release.tag_name }}'.substring(1);
const fs = require('fs');
const text = `cask "xmcl" do
version "${version}"
sha256 :no_check
arch arm: "arm64", intel: "x86_64"
on_arm do
url "https://github.com/Voxelum/x-minecraft-launcher/releases/download/v${version}/xmcl-${version}-arm64.dmg"
end
on_intel do
url "https://github.com/Voxelum/x-minecraft-launcher/releases/download/v${version}/xmcl-${version}-x64.dmg"
end
name "X Minecraft Launcher"
desc "An Open Source Minecraft Launcher with Modern UX. Provides a Disk Efficient way to manage all your Mods!"
homepage "https://xmcl.app"
livecheck do
url :url
strategy :header_match
end
app "X Minecraft Launcher.app"
zap trash: [
"~/Applications/X Minecraft Launcher.app",
"~/Library/Application Support/xmcl",
"~/Library/Preferences/xmcl.plist",
"~/Library/Saved Application State/xmcl.savedState"
]
end
`
fs.writeFileSync('./homebrew-xmcl/Casks/xmcl.rb', text);
- name: Create Release Note PR
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PAT_GITHUB_TOKEN }}
path: homebrew-xmcl
commit-message: "Bump xmcl to ${{ github.event.release.tag_name }}"
title: Bump xmcl to ${{ github.event.release.tag_name }}
body: Bump xmcl to ${{ github.event.release.tag_name }}
reviewers: ci010
assignees: ci010
branch: ${{ github.event.release.tag_name }}
update-winget:
needs:
- publish
name: Upload To winget
runs-on: windows-2019
defaults:
run:
shell: powershell
steps:
- name: Download Releases
uses: robinraju/release-downloader@v1.8
with:
repository: "voxelum/x-minecraft-launcher"
tag: ${{ github.event.release.tag_name }}
fileName: "version"
- uses: actions/github-script@v6
name: Get Release Version
id: version
with:
result-encoding: string
script: |
return '${{ github.event.release.tag_name }}'.substring(1);
- name: Update version env
run: |
echo "VERSION=$(cat ./version)" >> $env:GITHUB_ENV
- name: Create winget PR
run: |
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update CI010.XMinecraftLauncher -u $Env:URL -v $Env:VERSION -t $Env:TOKEN --submit
env:
TOKEN: ${{ secrets.PAT_GITHUB_TOKEN }}
URL: ${{ format('https://xmcl-release-ms.azureedge.net/releases/xmcl-{0}-win32-x64.appx', steps.version.outputs.result) }}
# publish-msstore:
# runs-on: windows-latest
# needs:
# - publish
# steps:
# - name: Download Releases
# uses: robinraju/release-downloader@v1.7
# with:
# repository: "voxelum/x-minecraft-launcher"
# tag: ${{ github.event.release.tag_name }}
# fileName: "xmcl-*.appx"
# out-file-path: build
# - name: Steup msstore cli
# uses: microsoft/setup-msstore-cli@main
# - name: Configure msstore cli
# run: |
# msstore reconfigure --tenantId ${{ secrets.AZURE_AD_TENANT_ID }} --clientSecret ${{ secrets.AZURE_AD_CLIENT_SECRET }} --clientId ${{ secrets.AZURE_AD_CLIENT_ID }} --sellerId ${{ secrets.SELLER_ID }}
# - name: Publish appx to msstore
# run: |
# msstore publish -v --appId 9MXJWHXTP4B9 --inputDirectory xmcl-electron-app/build/output