-
-
Notifications
You must be signed in to change notification settings - Fork 145
60 lines (51 loc) · 1.82 KB
/
msix.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
name: Upload store MSIX to release
permissions:
contents: write
on:
schedule:
- cron: "0 */6 * * *" # Run the action every 6 hours
workflow_dispatch: # Manually run the action
jobs:
check-msix:
runs-on: ubuntu-latest
steps:
- name: Check for MSIX file in latest release
id: check_msix
uses: actions/github-script@v6
with:
script: |
const { owner, repo } = context.repo;
const latestRelease = await github.rest.repos.getLatestRelease({ owner, repo });
// Check if .msix file exists in the release assets
const msixAsset = latestRelease.data.assets.find(asset => asset.name.endsWith('.msix'));
if (msixAsset) {
core.setOutput('MSIX_ALREADY_EXIST', 'true');
console.log('MSIX file exists.');
} else {
core.setOutput('MSIX_ALREADY_EXIST', 'false');
console.log('No MSIX file found in the latest release.');
}
- name: Output result
run: |
echo "MSIX_ALREADY_EXIST=${{ steps.check_msix.outputs.MSIX_ALREADY_EXIST }}"
upload-store-msix-to-release:
name: Upload Signed MSIX to release
needs: check-msix
if: needs.check-msix.outputs.MSIX_ALREADY_EXIST == 'false'
runs-on: ubuntu-latest
steps:
- name: Upload store MSIX to release
uses: JasonWei512/Upload-Microsoft-Store-MSIX-Package-to-GitHub-Release@v1
with:
store-id: 9p67c2d4t9fb
token: ${{ secrets.GITHUB_TOKEN }}
msix-to-winget:
name: MSIX to Winget
needs: upload-store-msix-to-release
runs-on: windows-latest
steps:
- uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Seelen.SeelenUI
installers-regex: '\.msix$'
token: ${{ secrets.WORKFLOWS_TOKEN }}