-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (100 loc) · 3.73 KB
/
Copy pathrelease.yml
File metadata and controls
121 lines (100 loc) · 3.73 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
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
name: Build & Release
on:
push:
tags:
- "v*.*.*"
pull_request:
branches:
- master
- main
env:
CARGO_TERM_COLOR: always
jobs:
# ── Check: runs on every PR and tag ──────────────────────────────────────
check:
name: Lint & Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy (deny warnings)
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test
# ── Release: only on version tags ────────────────────────────────────────
release:
name: Build Release Binary
runs-on: windows-latest
needs: check
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
- name: Build release binary
run: cargo build --release
- name: Rename binary with version
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
$src = "target\release\rampp.exe"
$dst = "rampp-${version}-windows-x64.exe"
Copy-Item $src $dst
Write-Host "Created: $dst"
- name: Generate SHA-256 checksum
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
$file = "rampp-${version}-windows-x64.exe"
$hash = (Get-FileHash $file -Algorithm SHA256).Hash.ToLower()
"$hash $file" | Out-File -Encoding ascii "${file}.sha256"
Write-Host "SHA256: $hash"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "RAMPP ${{ github.ref_name }}"
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
generate_release_notes: true
body: |
## Installation
1. Download `rampp-${{ github.ref_name }}-windows-x64.exe` and place it at `C:\rampp\rampp.exe`
2. Extract [Apache 2.4 (Win64, VS17)](https://www.apachelounge.com/download/) into `C:\rampp\apache\`
3. Extract [MySQL 9.x (ZIP)](https://dev.mysql.com/downloads/mysql/) into `C:\rampp\mysql\`
4. Install [Visual C++ Redistributable 2022 x64](https://aka.ms/vs/17/release/vc_redist.x64.exe)
5. Run `rampp.exe` — first-launch provisioning is automatic
Verify the download with the `.sha256` file:
```powershell
Get-FileHash rampp-${{ github.ref_name }}-windows-x64.exe -Algorithm SHA256
```
See [README](https://github.com/${{ github.repository }}/blob/master/README.md) for full documentation.
files: |
rampp-${{ github.ref_name }}-windows-x64.exe
rampp-${{ github.ref_name }}-windows-x64.exe.sha256