-
-
Notifications
You must be signed in to change notification settings - Fork 119
73 lines (65 loc) · 2.48 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
61
62
63
64
65
66
67
68
69
70
71
72
73
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
outputs:
MSIX_ALREADY_EXIST: ${{ steps.check_msix.outputs.MSIX_ALREADY_EXIST }}
steps:
- name: Check for MSIX file in latest release
id: check_msix
uses: actions/github-script@v7
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.');
}
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:
- name: Get Latest Release
id: get-version
uses: actions/github-script@v7
with:
script: |-
const { owner, repo } = context.repo;
const latestRelease = await github.rest.repos.getLatestRelease({ owner, repo });
const tag = latestRelease.data.tag_name;
const version = tag.replace("v", "") + ".0";
core.setOutput('version', version);
core.setOutput('release-tag', tag);
console.log("Release tag: ", tag, " Version: ", version);
- uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Seelen.SeelenUI
version: ${{ steps.get-version.outputs.version }}
release-tag: ${{ steps.get-version.outputs.release-tag }}
installers-regex: '\.msix$'
fork-user: eythaann
token: ${{ secrets.WINGET_TOKEN }}