-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (123 loc) · 4.34 KB
/
Copy pathrelease.yml
File metadata and controls
130 lines (123 loc) · 4.34 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
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: release-main
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
quality:
if: github.repository == 'code0xff/nightcrow'
name: Release quality gates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
with:
components: rustfmt
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 26
cache: npm
cache-dependency-path: viewer-ui/package-lock.json
- name: Verify package and release policy
run: node scripts/prepare-release.mjs check
- name: Test release automation
run: node --test scripts/prepare-release.test.mjs scripts/publish-release.test.mjs
- name: Rustfmt
run: cargo fmt --all --check
- name: Install viewer dependencies
run: npm ci
working-directory: viewer-ui
- name: Test viewer
run: npm test
working-directory: viewer-ui
- name: Build viewer
run: npm run build
working-directory: viewer-ui
- name: Check committed viewer bundle
run: git diff --exit-code -- viewer-ui/dist
build:
if: github.repository == 'code0xff/nightcrow'
needs: quality
name: Build ${{ matrix.asset }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset: nightcrow-x86_64-unknown-linux-gnu
suffix: ''
- os: windows-latest
target: x86_64-pc-windows-msvc
asset: nightcrow-x86_64-pc-windows-msvc.exe
suffix: .exe
- os: macos-15-intel
target: x86_64-apple-darwin
asset: nightcrow-x86_64-apple-darwin
suffix: ''
- os: macos-14
target: aarch64-apple-darwin
asset: nightcrow-aarch64-apple-darwin
suffix: ''
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c # v2
with:
key: release-${{ matrix.target }}
- name: Verify package and release policy
run: node scripts/prepare-release.mjs check
- name: Test workspace
run: cargo test --locked --workspace
- name: Clippy
run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
- name: Build release binary
run: cargo build --locked --release --target ${{ matrix.target }}
- name: Stage release asset
shell: bash
run: |
mkdir -p release-dist
cp "target/${{ matrix.target }}/release/nightcrow${{ matrix.suffix }}" "release-dist/${{ matrix.asset }}"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ matrix.asset }}
path: release-dist/${{ matrix.asset }}
if-no-files-found: error
publish:
if: github.repository == 'code0xff/nightcrow'
needs: [quality, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 26
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: release-dist
merge-multiple: true
- name: Validate exact next patch
id: version
shell: bash
run: echo "version=$(node scripts/prepare-release.mjs check --release --print-version)" >> "$GITHUB_OUTPUT"
- name: Create or verify the tag and GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: node scripts/publish-release.mjs --version "${{ steps.version.outputs.version }}" --dist release-dist