-
-
Notifications
You must be signed in to change notification settings - Fork 120
151 lines (127 loc) · 4.83 KB
/
nightly.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
name: Nightly
on:
push:
branches:
- master
workflow_dispatch:
jobs:
continuous-integration:
uses: ./.github/workflows/ci.yml
update-tag:
needs: continuous-integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- run: git fetch --tags --prune
- name: Create or update 'nightly' tag (force overwrite)
run: |
git tag -f nightly
git push origin --force --tags
- name: Confirm the tag was updated
run: git ls-remote --tags origin
build-installers:
needs: continuous-integration
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-06-25
- uses: Swatinem/rust-cache@v2
- name: Install frontend dependencies
run: npm clean-install
- name: Change version to nightly
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
const currentVersion = packageJson.version;
const timestamp = new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14);
const nightlyVersion = `${currentVersion}+${timestamp}`;
packageJson.version = nightlyVersion;
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
let cargoTomlContent = fs.readFileSync('Cargo.toml', 'utf-8');
cargoTomlContent = cargoTomlContent.replace(/^version\s*=\s*".*"/m, `version = "${nightlyVersion}"`);
fs.writeFileSync('Cargo.toml', cargoTomlContent);
# If build fails we will be without a nightly build until the next push or workflow_dispatch
- uses: tauri-apps/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: nightly
releaseName: Seelen UI Nightly
prerelease: true
includeDebug: true
args: ${{ matrix.args }}
- name: Install winget
if: matrix.platform == 'windows-latest'
uses: Cyberboss/install-winget@v1
- name: Install MSIX dependencies
if: matrix.platform == 'windows-latest'
shell: powershell
run: |
winget install --id Microsoft.DotNet.AspNetCore.8 --accept-package-agreements --accept-source-agreements --force
winget install --id Microsoft.DotNet.DesktopRuntime.8 --accept-package-agreements --accept-source-agreements --force
winget install --id MarcinOtorowski.MSIXHero --accept-package-agreements --accept-source-agreements --force
- name: Bundle MSIX
if: matrix.platform == 'windows-latest'
run: npx ts-node scripts/bundle.msix.ts
- name: Upload msix to release
if: matrix.platform == 'windows-latest'
uses: softprops/action-gh-release@v2
with:
tag_name: nightly
name: Seelen UI Nightly
prerelease: true
files: target/release/bundle/msix/*
remove-old-artifacts:
needs: build-installers
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Remove Signatures and Old Artifacts
uses: actions/github-script@v7
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const tagName = 'nightly';
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tagName,
});
const result = await github.rest.repos.listReleaseAssets({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
});
result.data.forEach(async (asset) => {
if (asset.name.endsWith('.sig')) {
await github.rest.repos.deleteReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
asset_id: asset.id,
});
}
});