-
-
Notifications
You must be signed in to change notification settings - Fork 105
113 lines (109 loc) · 3.65 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
name: Deploy Release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Download Releases
uses: robinraju/[email protected]
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-winget:
# needs:
# - publish
# name: Upload To winget
# runs-on: windows-2019
# defaults:
# run:
# shell: powershell
# steps:
# - name: Download Releases
# uses: robinraju/[email protected]
# 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}.appx', steps.version.outputs.result) }}
# publish-msstore:
# runs-on: windows-latest
# needs:
# - publish
# steps:
# - name: Download Releases
# uses: robinraju/[email protected]
# 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