-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (78 loc) · 2.98 KB
/
Copy pathrelease.yml
File metadata and controls
88 lines (78 loc) · 2.98 KB
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
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
permissions:
contents: write
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "npm"
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Get version from tag
id: get_version
shell: bash
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Read release notes
id: release_notes
shell: bash
run: |
VERSION=${{ steps.get_version.outputs.version }}
NOTES_FILE="RELEASE_NOTES/v${VERSION}.md"
if [ -f "$NOTES_FILE" ]; then
echo "notes<<EOF" >> $GITHUB_OUTPUT
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "Error: Release notes file $NOTES_FILE not found"
exit 1
fi
- name: Install dependencies
run: npm install
- uses: tauri-apps/tauri-action@v0
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: v${{ steps.get_version.outputs.version }}
releaseName: "Ghostie v${{ steps.get_version.outputs.version }}"
releaseBody: ${{ steps.release_notes.outputs.notes }}
releaseDraft: false
prerelease: false
- name: Fix latest.json repository url
shell: powershell
run: |
$version = "${{ steps.get_version.outputs.version }}"
$latestJsonFiles = Get-ChildItem -Path . -Filter "latest.json" -Recurse -File
foreach ($file in $latestJsonFiles) {
$content = Get-Content -Path $file.FullName -Raw | ConvertFrom-Json
if ($content.platforms.'windows-x86_64'.url -match "github.com/wangenius/ghostie/") {
$content.platforms.'windows-x86_64'.url = $content.platforms.'windows-x86_64'.url -replace "github.com/wangenius/ghostie/", "github.com/wangenius/ghostie-releases/"
$content | ConvertTo-Json -Depth 10 | Set-Content -Path $file.FullName
Write-Host "Updated repository path in $($file.FullName)"
}
}
- name: Create Release in ghostie-releases
uses: softprops/action-gh-release@v1
with:
files: |
src-tauri/target/release/bundle/**/*
./**/latest.json
repository: wangenius/ghostie-releases
tag_name: v${{ steps.get_version.outputs.version }}
name: "Ghostie v${{ steps.get_version.outputs.version }}"
body: ${{ steps.release_notes.outputs.notes }}
draft: false
prerelease: false
token: ${{ secrets.RELEASE_REPO_TOKEN }}