Repository navigation
183 lines (172 loc) · 6.15 KB
/
Copy pathrelease.yml
File metadata and controls
183 lines (172 loc) · 6.15 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: Release
# Builds Gitflow (GitHub Desktop with the AI features and team flows) for
# Linux, Windows and macOS.
#
# - Pushing a tag like v3.4.14-linux1-ai006 builds everything and publishes
# a GitHub release with the installers. The app version is taken from the
# tag (without the "v"). Number releases with three digits (ai006, ai007…)
# so Windows' updater, which compares them as text, keeps them in order.
# - The installed apps update themselves from the latest release (see
# app/src/main-process/fork-updater.ts), so every release must keep the
# file names below.
# - "Run workflow" in the Actions tab builds everything without publishing;
# the installers are attached to the run as artifacts.
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
env:
NODE_VERSION: 20.17.0
# Where the installed apps look for updates
DESKTOP_UPDATE_REPOSITORY: ${{ github.repository }}
jobs:
linux:
name: Linux x64
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Set version from tag
if: startsWith(github.ref, 'refs/tags/v')
run: node script/set-version-from-tag.js "${GITHUB_REF_NAME}"
# Builds inside an older Ubuntu container so the packages work on as
# many distributions as possible (same as upstream shiftkey/desktop).
- name: Build and package
uses: shiftkey/desktop-ubuntu-amd64-packaging@ea7b7a6a940a6b907b160b946439c5c7a516f9f1
- uses: actions/upload-artifact@v7
with:
name: linux-x64
path: |
dist/*.deb
dist/*.rpm
dist/*.AppImage
if-no-files-found: error
windows:
name: Windows x64
runs-on: windows-2022
timeout-minutes: 90
env:
DESKTOP_CUSTOM_BUILD: '1'
npm_config_arch: x64
TARGET_ARCH: x64
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Set version from tag
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: node script/set-version-from-tag.js "${GITHUB_REF_NAME}"
- uses: actions/setup-python@v7
with:
python-version: '3.11'
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- run: yarn
- run: yarn build:prod
- run: yarn package
- name: Collect installer and update package
shell: bash
run: |
mkdir -p release
# electron-winstaller writes the installer straight into dist/
cp dist/GitHubDesktopSetup-x64.exe release/GitHubDesktop-Windows-x64-Setup.exe
# Squirrel's update feed: the full package and its RELEASES index.
# package.ts renames the package to include the architecture, so
# point RELEASES at the new name.
cp dist/GitHubDesktop-*-x64-full.nupkg release/
sed 's/-full\.nupkg/-x64-full.nupkg/' dist/RELEASES > release/RELEASES
cat release/RELEASES
- uses: actions/upload-artifact@v7
with:
name: windows-x64
path: release/*
if-no-files-found: error
macos:
name: macOS ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
# Both on the Intel runners (the Apple Silicon build is cross-compiled,
# as upstream does): GitHub's arm64 macOS runners are often too busy
# to pick up the job at all.
include:
- os: macos-15-intel
arch: arm64
- os: macos-15-intel
arch: x64
env:
DESKTOP_CUSTOM_BUILD: '1'
npm_config_arch: ${{ matrix.arch }}
TARGET_ARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Set version from tag
if: startsWith(github.ref, 'refs/tags/v')
run: node script/set-version-from-tag.js "${GITHUB_REF_NAME}"
- uses: actions/setup-python@v7
with:
python-version: '3.11'
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- run: yarn
- run: yarn build:prod
- run: yarn package
- name: Collect app
run: |
mkdir -p release
# The zip is named after the product (Gitflow); the release keeps the
# file name the installed apps' updater looks for.
cp "dist/Gitflow-${{ matrix.arch }}.zip" "release/GitHubDesktop-macOS-${{ matrix.arch }}.zip"
- uses: actions/upload-artifact@v7
with:
name: macos-${{ matrix.arch }}
path: release/*
if-no-files-found: error
publish:
name: Publish release
needs: [linux, windows, macos]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: Checksums
working-directory: artifacts
run: sha256sum * > SHA256SUMS.txt && cat SHA256SUMS.txt
- uses: softprops/action-gh-release@v3
with:
name: Gitflow ${{ github.ref_name }}
generate_release_notes: true
body: |
## Installers
| System | File |
|---|---|
| Linux (Debian/Ubuntu/Mint) | `.deb` — `sudo apt install --reinstall ./GitHubDesktop-linux-amd64-*.deb` |
| Linux (Fedora/RHEL) | `.rpm` |
| Linux (any) | `.AppImage` |
| Windows | `GitHubDesktop-Windows-x64-Setup.exe` (SmartScreen: "More info" → "Run anyway") |
| macOS Apple Silicon | `GitHubDesktop-macOS-arm64.zip` |
| macOS Intel | `GitHubDesktop-macOS-x64.zip` |
**macOS:** unzip, move *Gitflow* to Applications and run once
`xattr -cr "/Applications/Gitflow.app"` (the app is not notarized by Apple).
Installed apps update themselves from these releases (Flows → Check for updates).
files: artifacts/*
fail_on_unmatched_files: true