-
-
Notifications
You must be signed in to change notification settings - Fork 246
122 lines (104 loc) · 2.99 KB
/
release.yml
File metadata and controls
122 lines (104 loc) · 2.99 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag for release (e.g., v1.0.0)'
required: true
default: v4.0.0
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-15-intel
platform: mac
arch: x64
- os: macos-15
platform: mac
arch: arm64
- os: windows-latest
platform: win
- os: ubuntu-latest
platform: linux
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.16.0
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Rebuild native dependencies (macOS)
if: matrix.platform == 'mac'
run: pnpm run rebuild --arch ${{ matrix.arch }}
- name: Rebuild native dependencies (other platforms)
if: matrix.platform != 'mac'
run: pnpm run rebuild
- name: Build application (macOS)
if: matrix.platform == 'mac'
run: pnpm run build:${{ matrix.platform }}:${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build application (other platforms)
if: matrix.platform != 'mac'
run: pnpm run build:${{ matrix.platform }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: masscode-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.ref_name || inputs.tag }}
path: |
dist/*.dmg
dist/*.pkg
dist/*.exe
dist/*.msi
dist/*.AppImage
dist/*.snap
!dist/*-sponsored.*
!dist/*.yml
!dist/*.blockmap
if-no-files-found: warn
retention-days: 30
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts from "build" job
uses: actions/download-artifact@v4
with:
pattern: masscode-*
path: artifacts
- name: Generate changelog
run: npx changelogithub --output release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
tag_name: ${{ github.ref_name || inputs.tag }}
draft: true
body_path: release-notes.md
generate_release_notes: true
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}